diff --git a/app/Controller/v3/NotifyController.php b/app/Controller/v3/NotifyController.php index 6b74410..b38a27d 100644 --- a/app/Controller/v3/NotifyController.php +++ b/app/Controller/v3/NotifyController.php @@ -288,6 +288,7 @@ class NotifyController extends BaseController { $config = config('wxpay'); + var_dump('wxpay$config', $config); $app = Factory::payment($config); $app['guzzle_handler'] = CoroutineHandler::class; @@ -303,6 +304,8 @@ class NotifyController extends BaseController // 通知回调,进行业务处理 $response = $app->handleRefundedNotify(function ($message, $reqInfo, $fail) use ($app) { + var_dump('messga', $message); + var_dump('$reqInfo', $reqInfo); Db::beginTransaction(); try { // 支付失败或者通知失败 @@ -323,7 +326,7 @@ class NotifyController extends BaseController // 查询订单 $orderMain = OrderMain::query() ->whereIn('state', [OrderState::PAID, OrderState::DELIVERY, OrderState::COMPLETED, OrderState::EVALUATED, OrderState::REFUNDING]) - ->where(['global_order_id' => $message['global_order_id'], 'pay_type' => Payment::WECHAT, 'refund_time' => 0]) + ->where(['global_order_id' => $message['out_trade_no'], 'pay_type' => Payment::WECHAT, 'refund_time' => 0]) ->first(); // 订单不存在 diff --git a/app/JsonRpc/OrdersService.php b/app/JsonRpc/OrdersService.php index 32d4ef9..480f9a1 100644 --- a/app/JsonRpc/OrdersService.php +++ b/app/JsonRpc/OrdersService.php @@ -95,7 +95,8 @@ class OrdersService implements OrdersServiceInterface public function onlineRefund($global_order_id, $user_id) { try { - $this->orderOnlineService->doRefund($global_order_id, $user_id); + $result = $this->orderOnlineService->doRefund($global_order_id, $user_id); + var_dump('$result', $result); return [ "status" => 200, "code" => 0, diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 58e0764..57b265a 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -584,6 +584,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface { $orderMain = $this->check($globalOrderId, $userId, OrderState::REFUNDING); + var_dump('$orderMain', $orderMain); // 微信退款 if ($orderMain->pay_type == Payment::WECHAT) { return $this->paymentService->undo($orderMain->global_order_id, $userId); diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index 4d81f26..296440b 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -136,6 +136,7 @@ class PaymentService implements PaymentServiceInterface 'notify_url' => config('wechat.notify_url.refund'), ] ); + var_dump('payresult', $result); if ($result['return_code'] == 'SUCCESS' && isset($result['result_code']) && $result['result_code'] == "SUCCESS") { return true; } else {