diff --git a/app/JsonRpc/OrderService.php b/app/JsonRpc/OrderService.php index 1f49932..530d09e 100644 --- a/app/JsonRpc/OrderService.php +++ b/app/JsonRpc/OrderService.php @@ -78,32 +78,21 @@ class OrderService implements OrderServiceInterface */ public function onlineRefund($global_order_id, $user_id) { - - Db::beginTransaction(); try { - $result = $this->orderOnlineService->doRefund($global_order_id, $user_id); - - Db::commit(); - if ($result['return_code'] == 'SUCCESS' && isset($result['result_code']) && $result['result_code'] == "SUCCESS") { - return [ - "status" => 200, - "code" => 0, - "result" => [], - "message" => '处理成功' - ]; - } else { - return [ - "status" => 200, - "code" => -1, - "result" => [], - "message" => $result['err_code_des'] - ]; - } + $this->orderOnlineService->doRefund($global_order_id, $user_id); + return [ + "status" => 200, + "code" => 0, + "result" => [], + "message" => '处理成功' + ]; } catch (\Exception $e) { - - Db::rollBack(); - $this->log->event(LogLabel::ORDER_REFUND_LOG, ['jsonrpc_order_service_exception_onlineRefund' => $e->getMessage(), 'params' => json([$global_order_id, $user_id])]); - throw new ErrorCodeException(ErrorCode::ORDER_REFUND_FAIL); + return [ + "status" => 200, + "code" => $e->getCode(), + "result" => [], + "message" => $e->getMessage() + ]; } } diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index e979635..58b25b5 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -127,6 +127,14 @@ class PaymentService implements PaymentServiceInterface 'notify_url' => config('wechat.notify_url.refund'), ] ); + if ($result['return_code'] == 'SUCCESS' && isset($result['result_code']) && $result['result_code'] == "SUCCESS") { + return true; + } else { + throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL); + } + + + return $result; } catch (\Exception $e) { $this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]);