@@ -28,14 +28,14 @@ |
||
| 28 | 28 | |
| 29 | 29 | $destination = $rocket->getDestination(); |
| 30 | 30 | $payload = $rocket->getPayload(); |
| 31 | - $resultKey = str_replace('.', '_', $payload->get('method')).'_response'; |
|
| 31 | + $resultKey = str_replace('.', '_', $payload->get('method')) . '_response'; |
|
| 32 | 32 | |
| 33 | 33 | if (should_do_http_request($rocket->getDirection()) && $destination instanceof Collection) { |
| 34 | 34 | $sign = $destination->get('sign', ''); |
| 35 | 35 | $response = $destination->get($resultKey, $destination->all()); |
| 36 | 36 | |
| 37 | 37 | if (empty($sign) && '10000' !== ($response['code'] ?? 'null')) { |
| 38 | - throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, '支付宝网关响应异常: '.($response['sub_msg'] ?? $response['msg'] ?? '未知错误,请查看支付宝原始响应'), $rocket->getDestination()); |
|
| 38 | + throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, '支付宝网关响应异常: ' . ($response['sub_msg'] ?? $response['msg'] ?? '未知错误,请查看支付宝原始响应'), $rocket->getDestination()); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $rocket->setDestination(new Collection(array_merge( |
@@ -50,8 +50,8 @@ |
||
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | 52 | '_method' => 'POST', |
| 53 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 54 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
| 57 | 57 | )); |
@@ -49,8 +49,8 @@ |
||
| 49 | 49 | $rocket->setDirection(OriginResponseDirection::class) |
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 52 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 53 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | 54 | '_method' => 'POST', |
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
@@ -50,8 +50,8 @@ |
||
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | 52 | '_method' => 'POST', |
| 53 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 54 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
| 57 | 57 | )); |
@@ -50,8 +50,8 @@ |
||
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | 52 | '_method' => 'POST', |
| 53 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 54 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
| 57 | 57 | )); |
@@ -44,8 +44,8 @@ |
||
| 44 | 44 | $rocket->setDirection(OriginResponseDirection::class) |
| 45 | 45 | ->mergePayload([ |
| 46 | 46 | '_method' => 'POST', |
| 47 | - '_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', |
|
| 48 | - '_service_url' => 'v3/combine-transactions/out-trade-no/'.$combineOutTradeNo.'/close', |
|
| 47 | + '_url' => 'v3/combine-transactions/out-trade-no/' . $combineOutTradeNo . '/close', |
|
| 48 | + '_service_url' => 'v3/combine-transactions/out-trade-no/' . $combineOutTradeNo . '/close', |
|
| 49 | 49 | 'combine_appid' => $payload->get('combine_appid', $config[get_wechat_type_key($params)] ?? ''), |
| 50 | 50 | ]) |
| 51 | 51 | ->exceptPayload('combine_out_trade_no'); |
@@ -50,8 +50,8 @@ |
||
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | 52 | '_method' => 'POST', |
| 53 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 54 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
| 57 | 57 | )); |
@@ -81,11 +81,11 @@ |
||
| 81 | 81 | if (Str::contains($body, '&-&')) { |
| 82 | 82 | $beginIndex = strpos($body, '&signType='); |
| 83 | 83 | $endIndex = strpos($body, '&-&'); |
| 84 | - $data = substr($body, 0, $beginIndex).substr($body, $endIndex); |
|
| 84 | + $data = substr($body, 0, $beginIndex) . substr($body, $endIndex); |
|
| 85 | 85 | |
| 86 | 86 | $signIndex = strpos($body, '&sign='); |
| 87 | 87 | $signature = substr($body, $signIndex + strlen('&sign='), $endIndex - ($signIndex + strlen('&sign='))); |
| 88 | - } else { |
|
| 88 | + }else { |
|
| 89 | 89 | $result = Arr::wrapQuery($body, true); |
| 90 | 90 | $result = Collection::wrap($result); |
| 91 | 91 | $signature = $result->get('sign'); |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | $rocket->setPayload(array_merge( |
| 52 | 52 | [ |
| 53 | 53 | '_method' => 'POST', |
| 54 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/reverse', |
|
| 55 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/reverse', |
|
| 54 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/reverse', |
|
| 55 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/reverse', |
|
| 56 | 56 | ], |
| 57 | 57 | $data ?? $this->normal($params, $config) |
| 58 | 58 | )); |