diff --git a/app/JsonRpc/LocationService.php b/app/JsonRpc/LocationService.php new file mode 100644 index 0000000..bb9358f --- /dev/null +++ b/app/JsonRpc/LocationService.php @@ -0,0 +1,32 @@ +locationService->getDistanceByTencent($lng1, $lat1, $lng2, $lat2); + } +} \ No newline at end of file diff --git a/app/JsonRpc/LocationServiceInterface.php b/app/JsonRpc/LocationServiceInterface.php new file mode 100644 index 0000000..cf076bb --- /dev/null +++ b/app/JsonRpc/LocationServiceInterface.php @@ -0,0 +1,10 @@ +orderOnlineService->doRefund($global_order_id, $user_id); + $result = $this->orderOnlineService->doRefund($global_order_id, $user_id); Db::commit(); - return [ - "status" => 200, - "code" => 0, - "result" => [], - "message" => '处理成功' - ]; + 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'] + ]; + } } catch (\Exception $e) { Db::rollBack(); diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index d447fa8..e979635 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -127,11 +127,7 @@ 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, '[退款失败]'.$result['err_code_des']); - } + return $result; } catch (\Exception $e) { $this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]); throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, '[退款失败]'.$e->getMessage()); diff --git a/config/autoload/dependencies.php b/config/autoload/dependencies.php index d225a6c..f24a9f6 100644 --- a/config/autoload/dependencies.php +++ b/config/autoload/dependencies.php @@ -80,4 +80,5 @@ return [ \App\Service\v3\Interfaces\SmsServiceInterface::class => \App\Service\v3\Implementations\SmsAliService::class, \App\Service\v3\Interfaces\AttachmentServiceInterface::class => \App\Service\v3\Implementations\AttachmentService::class, \App\JsonRpc\PrintServiceInterface::class => \App\JsonRpc\FeieService::class, + \App\JsonRpc\LocationServiceInterface::class => \App\JsonRpc\LocationService::class, ];