|
|
|
@ -26,6 +26,7 @@ use app\common\library\payment\Facade as PaymentFacade; |
|
|
|
|
use app\common\library\payment\gateway\Driver; |
|
|
|
|
use app\common\library\payment\gateway\driver\wechat\V3 as WechatPaymentV3; |
|
|
|
|
use cores\exception\BaseException; |
|
|
|
|
use think\facade\Db; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 服务类:第三方支付异步通知 |
|
|
|
@ -67,6 +68,7 @@ class Notify |
|
|
|
|
*/ |
|
|
|
|
public function wechatV3(): string |
|
|
|
|
{ |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入v3', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
try { |
|
|
|
|
// 通过微信支付v3平台证书序号 获取支付模板 |
|
|
|
|
$wechatpaySerial = \request()->header('wechatpay-serial'); |
|
|
|
@ -131,6 +133,7 @@ class Notify |
|
|
|
|
*/ |
|
|
|
|
private function orderPaySucces(PaymentTradeModel $tradeInfo, array $paymentData) |
|
|
|
|
{ |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '第一步', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
// 记录日志 |
|
|
|
|
Log::append('Notify-orderPaySucces', [ |
|
|
|
|
'orderType' => OrderTypeEnum::data()[$tradeInfo['order_type']]['name'], |
|
|
|
@ -166,6 +169,7 @@ class Notify |
|
|
|
|
} |
|
|
|
|
// 订单支付成功业务处理 (开通会员、分销商) |
|
|
|
|
if ($tradeInfo['order_type'] == OrderTypeEnum::MEMBER || $tradeInfo['order_type'] == OrderTypeEnum::DEALER) { |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '进入异步通知开始处理会员分销业务', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
$service = new identity\PaySuccess(); |
|
|
|
|
$service->setOrderNo($tradeInfo['order_no']) |
|
|
|
|
->setMethod($tradeInfo['pay_method']) |
|
|
|
|