|
@@ -29,7 +29,6 @@ class Cmbc extends Core
|
|
|
$tools = new \Cmbc\Handle();
|
|
|
$callback = $tools->get('notify', $this->config);
|
|
|
$result = $callback->request(Dever::input(), $this);
|
|
|
- print_r($result);die;
|
|
|
$this->log('支付回调-获取数据', $result);
|
|
|
$this->updateOrder($result['mhtOrderNo'], $result['mhtOrderAmt'], $msg);
|
|
|
}
|
|
@@ -37,7 +36,7 @@ class Cmbc extends Core
|
|
|
/**
|
|
|
* 获取统一下单的基本信息
|
|
|
*/
|
|
|
- public function order($account_id, $uid, $username, $product_id, $name, $cash, $openid = false, $type = 1, $order_id = false)
|
|
|
+ public function order($account_id, $project_id, $uid, $username, $product_id, $name, $cash, $openid = false, $type = 1, $order_id = false)
|
|
|
{
|
|
|
$trade_type = $this->getType($type);
|
|
|
$order_id = $this->createOrder($uid, $username, $account_id, $product_id, $name, $cash, $this->config->getType(), $order_id);
|
|
@@ -52,11 +51,13 @@ class Cmbc extends Core
|
|
|
$request['mhtOrderStartTime'] = date("YmdHis");
|
|
|
$request['notifyUrl'] = $this->config->getNotifyUrl();
|
|
|
$request['outputType'] = 1;
|
|
|
- $request['mhtSubAppId'] = '?';
|
|
|
- $request['consumerId'] = $openid;
|
|
|
-
|
|
|
+ if (!$openid) {
|
|
|
+ $request['consumerId'] = 'ofBUV0RUoy_8C4VctZjrSDGzhUfY';
|
|
|
+ } else {
|
|
|
+ $request['consumerId'] = $openid;
|
|
|
+ }
|
|
|
+
|
|
|
$result = $order->request($request);
|
|
|
- print_r($result);die;
|
|
|
$this->updateOrderParam($order_id, $result);
|
|
|
return $result;
|
|
|
}
|
|
@@ -77,18 +78,15 @@ class Cmbc extends Core
|
|
|
*/
|
|
|
public function applet($order)
|
|
|
{
|
|
|
+ $result = array();
|
|
|
if (isset($order['prepay_id'])) {
|
|
|
-
|
|
|
- $string = 'appId='.$this->config->getAppId().'&nonceStr='.$order['nonce_str'].'&package=prepay_id='.$order['prepay_id'].'&signType='.$order['sign_type'].'&timeStamp='.$order['time'].'&key='.$this->config->getKey();
|
|
|
- if($order['sign_type'] == "MD5"){
|
|
|
- $string = md5($string);
|
|
|
- } else {
|
|
|
- $string = hash_hmac("sha256", $string, $this->config->getKey());
|
|
|
- }
|
|
|
-
|
|
|
- $order['sign'] = $string;
|
|
|
+ $result['time'] = $order['timeStamp'];
|
|
|
+ $result['nonce_str'] = $order['nonceStr'];
|
|
|
+ $result['prepay_id'] = $order['prepay_id'];
|
|
|
+ $result['sign_type'] = $order['signType'];
|
|
|
+ $result['sign'] = $order['paySign'];
|
|
|
}
|
|
|
- return $order;
|
|
|
+ return $result;
|
|
|
}
|
|
|
|
|
|
|