master
wangxinglong 2021-12-09 13:58:21 +08:00
parent 856f1fa53f
commit 2345115913
2 changed files with 57 additions and 56 deletions

View File

@ -368,7 +368,7 @@ class Business extends Base
];
$payData['sign'] = generate_sign($payData, config("wechat.key"));
$payData['order_num'] = $order->order_num;
Db::commit();
return $this->json(0, "success", [
"payData" => $payData

View File

@ -82,8 +82,9 @@ class Recharge extends Base
*
* @throws \EasyWeChat\Kernel\Exceptions\Exception
*/
public function notify(){
if ($this->request->isPost()) {
public function notify()
{
$app = WechatPay::getInstance();
$response = $app->handlePaidNotify(function ($message, $fail) {
// $aa = '{"appid":"wxa02e44170bc722cd","bank_type":"OTHERS","cash_fee":"1","fee_type":"CNY","is_subscribe":"N","mch_id":"1605090111","nonce_str":"60f7d8a1e4ac8","openid":"oKrEm0ehgsy2ZTWzEva4tbLuUgFw","out_trade_no":"16268555858753004863","result_code":"SUCCESS","return_code":"SUCCESS","sign":"DB3F6CDCB7FBB3B9DDF7C0CC8BBD5AAD","time_end":"20210721162000","total_fee":"1","trade_type":"JSAPI","transaction_id":"4200001200202107217942681078"}';
@ -145,7 +146,7 @@ class Recharge extends Base
});
$response->send();
}
}
/**
* 记录订单日志