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

微信支付

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