|
@@ -11,7 +11,6 @@ class Lakala
|
|
|
private $term_no;
|
|
private $term_no;
|
|
|
private $merchantPrivateKeyPath;
|
|
private $merchantPrivateKeyPath;
|
|
|
private $lklCertificatePath;
|
|
private $lklCertificatePath;
|
|
|
- private $subject;
|
|
|
|
|
private $schema = 'LKLAPI-SHA256withRSA';
|
|
private $schema = 'LKLAPI-SHA256withRSA';
|
|
|
private $version = '3.0';
|
|
private $version = '3.0';
|
|
|
private $preUrl = '';
|
|
private $preUrl = '';
|
|
@@ -31,8 +30,34 @@ class Lakala
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //支付宝
|
|
|
|
|
- public function aliPay($orderSn, $amount)
|
|
|
|
|
|
|
+ //主扫交易,支付宝
|
|
|
|
|
+ public function driveWxPay($orderSn, $amount)
|
|
|
|
|
+ {
|
|
|
|
|
+ $location_info = ['request_ip' => '183.250.29.250'];
|
|
|
|
|
+ $arr = [
|
|
|
|
|
+ 'merchant_no' => $this->merchant_no,
|
|
|
|
|
+ 'term_no' => $this->term_no,
|
|
|
|
|
+ 'out_trade_no' => $orderSn,
|
|
|
|
|
+ 'account_type' => 'WECHAT',
|
|
|
|
|
+ 'trans_type' => '41',
|
|
|
|
|
+ 'total_amount' => $amount * 100,
|
|
|
|
|
+ 'location_info' => $location_info,
|
|
|
|
|
+ 'subject' => '奥式生活订单',
|
|
|
|
|
+ 'notify_url' => '',
|
|
|
|
|
+ 'remark' => '',
|
|
|
|
|
+ ];
|
|
|
|
|
+ $baseRequestVO = [
|
|
|
|
|
+ 'req_data' => $arr,
|
|
|
|
|
+ 'req_time' => date("YmdHis"),
|
|
|
|
|
+ 'version' => $this->version,
|
|
|
|
|
+ ];
|
|
|
|
|
+ $body = json_encode($baseRequestVO, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ $authorization = $this->getAuthorization($body);
|
|
|
|
|
+ return $this->post($this->preUrl . 'preorder', $body, $authorization);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //主扫交易,支付宝
|
|
|
|
|
+ public function driveAliPay($orderSn, $amount)
|
|
|
{
|
|
{
|
|
|
$location_info = ['request_ip' => '183.250.29.250'];
|
|
$location_info = ['request_ip' => '183.250.29.250'];
|
|
|
$arr = [
|
|
$arr = [
|
|
@@ -57,8 +82,10 @@ class Lakala
|
|
|
return $this->post($this->preUrl . 'preorder', $body, $authorization);
|
|
return $this->post($this->preUrl . 'preorder', $body, $authorization);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function wechat()
|
|
|
|
|
|
|
+ //主扫交易,微信
|
|
|
|
|
+ public function driveWxPay()
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//验签
|
|
//验签
|
|
@@ -115,7 +142,6 @@ class Lakala
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
$res = curl_exec($ch);
|
|
$res = curl_exec($ch);
|
|
|
curl_close($ch);
|
|
curl_close($ch);
|
|
|
-print_r($res);die;
|
|
|
|
|
return json_decode($res, 1);
|
|
return json_decode($res, 1);
|
|
|
}
|
|
}
|
|
|
|
|
|