|
|
|
@ -68,6 +68,7 @@ class Notify |
|
|
|
|
*/ |
|
|
|
|
public function wechatV3(): string |
|
|
|
|
{ |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => "进入回调第二步", 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
try { |
|
|
|
|
// 通过微信支付v3平台证书序号 获取支付模板 |
|
|
|
|
$wechatpaySerial = \request()->header('wechatpay-serial'); |
|
|
|
@ -84,7 +85,7 @@ class Notify |
|
|
|
|
$platformCertificateFilePath = PaymentTemplateModel::realPathCertFile( |
|
|
|
|
PaymentMethodEnum::WECHAT, $fileName, $templateInfo['store_id'] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => "进入回调第三步", 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
// 验证异步通知是否合法并获取第三方支付交易订单号 |
|
|
|
|
$V3 = new WechatPaymentV3(); |
|
|
|
|
$outTradeNo = $V3->notify($apiv3Key, $platformCertificateFilePath); |
|
|
|
@ -93,6 +94,7 @@ class Notify |
|
|
|
|
// 获取第三方交易记录 |
|
|
|
|
$tradeInfo = PaymentTradeModel::detailByOutTradeNo($outTradeNo); |
|
|
|
|
// 订单支付成功事件 |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => "进入回调第四步", 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
$this->orderPaySucces($tradeInfo, $V3->getNotifyParams()); |
|
|
|
|
} catch (\Throwable $e) { |
|
|
|
|
// 记录错误日志 |
|
|
|
@ -137,6 +139,7 @@ class Notify |
|
|
|
|
'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'], |
|
|
|
|
'tradeInfo' => $tradeInfo->toArray(), |
|
|
|
|
]); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => "进入回调第五步", 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
try { |
|
|
|
|
// 订单支付成功业务处理 (商城订单) |
|
|
|
|
if ($tradeInfo['order_type'] == OrderTypeEnum::ORDER) { |
|
|
|
|