作者 景龙
1 个管道 的构建 失败 耗费 0 秒

微信支付

@@ -74,9 +74,11 @@ class Wxpay extends Api @@ -74,9 +74,11 @@ class Wxpay extends Api
74 'total_fee' => 1, 74 'total_fee' => 1,
75 //'total_fee' => floatval($total_price)*100,//单位:分 75 //'total_fee' => floatval($total_price)*100,//单位:分
76 'openid' => $openid, 76 'openid' => $openid,
77 - 'notify_url' => $this->request->root(true) . '/api/Wxpay/notify',  
78 - 'return_url' => $this->request->root(true) . '/api/Wxpay/wechatReturn', 77 + 'notify_url' => url('api/Wxpay/notify','','',true),
  78 + 'return_url' => url('api/Wxpay/wechatReturn','','',true),
79 ]; 79 ];
  80 + Log::info('订单生成');
  81 + Log::info($order);
80 //跳转或输出 82 //跳转或输出
81 $this->success('成功',$pay->miniapp($order)); 83 $this->success('成功',$pay->miniapp($order));
82 84
@@ -89,8 +91,9 @@ class Wxpay extends Api @@ -89,8 +91,9 @@ class Wxpay extends Api
89 * 支付成功回调 91 * 支付成功回调
90 */ 92 */
91 public function notify(){ 93 public function notify(){
  94 + Log::info('支付成功回调');
  95 +
92 $pay = Service::checkNotify('wechat'); 96 $pay = Service::checkNotify('wechat');
93 - return $pay;  
94 if (!$pay) { 97 if (!$pay) {
95 $this->error('签名错误'); 98 $this->error('签名错误');
96 } 99 }