作者 李涵
1 个管道 的构建 通过 耗费 0 秒

合并分支 'li' 到 'master'

测试



查看合并请求 !45
... ... @@ -89,7 +89,25 @@ class PayController extends HomeBaseController
public function notify()
{
$pay = new \Payment();
$pay->handleNotify();
$notify = $pay->handleNotify();
if(!empty($notify)) {
$oid = $notify['attach'];
if(Db::name('zj_order')->where(['id'=>$oid])->value('step') == 2) {
echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
exit();
}else {
//改变订单状态
$update = [
'id' => $oid,
'step' => 2
];
if(Db::name('zj_order')->update($update)) {
echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
exit();
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -233,6 +233,9 @@
if(pay_type == '') {
return false;
}
if(address_id == '') {
return false;
}
$.ajax({
url:"{:url('pay/Pay/done')}",
data:{
... ... @@ -253,7 +256,7 @@
paySign: data.data.paySign, // 支付签名
success: function (res) {
window.location.href=data.url;
}
},
});
}
}
... ... @@ -288,7 +291,7 @@
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '{$js_sdk.appId}', // 必填,公众号的唯一标识
timestamp: '{$js_sdk.timestamp}', // 必填,生成签名的时间戳
nonceStr: '{$js_sdk.nonceStr}', // 必填,生成签名的随机串
... ...
... ... @@ -170,7 +170,7 @@ class Payment {
$signA = "appid=".$data['appid']."&attach=".$data['attach']."&bank_type=".$data['bank_type']."&cash_fee=".$data['cash_fee']."&fee_type=".$data['fee_type']."&is_subscribe=".$data['is_subscribe']."&mch_id=".$data['mch_id']."&nonce_str=".$data['nonce_str']."&openid=". $data['openid']."&out_trade_no=".$data['out_trade_no']."&result_code=".$data['result_code']."&return_code=".$data['return_code']."&time_end=".$data['time_end']."&total_fee=".$data['total_fee']."&trade_type=".$data['trade_type']."&transaction_id=".$data['transaction_id']."&key=".config('Key');
$sign = strtoupper(MD5($signA));
if($sign == $data['sign']) {
return $data['attach'];
return $data;
}else {
return false;
}
... ...