From d391d7dcba51caa6fe888c63d1750629b67b33bd Mon Sep 17 00:00:00 2001 From: dayu Date: Sat, 1 Feb 2020 23:03:54 +0800 Subject: [PATCH] feat(wechat): change out_xxx to xxx --- examples/wx/closeTrade.php | 2 +- examples/wx/queryOrder.php | 2 +- examples/wx/queryRefund.php | 2 +- examples/wx/refund.php | 2 +- examples/wx/transfer.php | 2 +- src/Gateways/Wechat/Bill.php | 2 +- src/Gateways/Wechat/CloseTrade.php | 4 ++-- src/Gateways/Wechat/Refund.php | 4 ++-- src/Gateways/Wechat/RefundQuery.php | 4 ++-- src/Gateways/Wechat/Settlement.php | 2 +- src/Gateways/Wechat/TradeQuery.php | 2 +- src/Gateways/Wechat/Transfer.php | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/wx/closeTrade.php b/examples/wx/closeTrade.php index 97141d9e..bb6f5539 100644 --- a/examples/wx/closeTrade.php +++ b/examples/wx/closeTrade.php @@ -16,7 +16,7 @@ // 订单信息 $params = [ - 'out_trade_no' => '15546387228443', + 'trade_no' => '15546387228443', 'transaction_id' => '', ]; diff --git a/examples/wx/queryOrder.php b/examples/wx/queryOrder.php index 07f57323..8dd7d42c 100644 --- a/examples/wx/queryOrder.php +++ b/examples/wx/queryOrder.php @@ -16,7 +16,7 @@ $wxConfig = require_once __DIR__ . '/../wxconfig.php'; $data = [ - 'out_trade_no' => '15805490027722', + 'trade_no' => '15805490027722', //'transaction_id' => '4557984565220190407200528457633', ]; diff --git a/examples/wx/queryRefund.php b/examples/wx/queryRefund.php index f722cd1d..28a7ad33 100644 --- a/examples/wx/queryRefund.php +++ b/examples/wx/queryRefund.php @@ -15,7 +15,7 @@ $wxConfig = require_once __DIR__ . '/../wxconfig.php'; $data = [ - 'out_trade_no' => '15805490027722', + 'trade_no' => '15805490027722', //'refund_no' => '15805498596435', //'transaction_id' => '4988319909620200201172451651106', //'refund_id' => '4196711984120200201173913842', diff --git a/examples/wx/refund.php b/examples/wx/refund.php index da7de609..1e248072 100644 --- a/examples/wx/refund.php +++ b/examples/wx/refund.php @@ -17,7 +17,7 @@ $refundNo = time() . rand(1000, 9999); $data = [ - 'out_trade_no' => '15805490027722', + 'trade_no' => '15805490027722', 'transaction_id' => '4988319909620200201172451651106', 'total_fee' => '5.52', 'refund_fee' => '5.52', diff --git a/examples/wx/transfer.php b/examples/wx/transfer.php index e3d9605a..43a45335 100644 --- a/examples/wx/transfer.php +++ b/examples/wx/transfer.php @@ -25,7 +25,7 @@ 'payer_real_name' => 'dayu', 'amount' => '1', 'desc' => '测试转账', - 'spbill_create_ip' => '127.0.0.1', + 'client_ip' => '127.0.0.1', // bank 的参数 /*'trans_no' => time(), diff --git a/src/Gateways/Wechat/Bill.php b/src/Gateways/Wechat/Bill.php index 60f2c5e1..94c7cccc 100644 --- a/src/Gateways/Wechat/Bill.php +++ b/src/Gateways/Wechat/Bill.php @@ -88,7 +88,7 @@ protected function getSelfParams(array $requestParams) $selfParams = [ 'bill_date' => $requestParams['bill_date'] ?? '', 'bill_type' => $requestParams['bill_type'] ?? 'ALL', - 'tar_type' => $requestParams['tar_type'] ?? '', + //'tar_type' => $requestParams['tar_type'] ?? '', ]; return $selfParams; diff --git a/src/Gateways/Wechat/CloseTrade.php b/src/Gateways/Wechat/CloseTrade.php index 3f8f0c12..17e60454 100644 --- a/src/Gateways/Wechat/CloseTrade.php +++ b/src/Gateways/Wechat/CloseTrade.php @@ -21,7 +21,7 @@ * @email : dayugog@gmail.com * @date : 2019/4/1 8:27 PM * @version : 1.0.0 - * @desc : + * @desc : 关闭交易 **/ class CloseTrade extends WechatBaseObject implements IGatewayRequest { @@ -49,7 +49,7 @@ public function request(array $requestParams) protected function getSelfParams(array $requestParams) { $selfParams = [ - 'out_trade_no' => $requestParams['out_trade_no'] ?? '', + 'out_trade_no' => $requestParams['trade_no'] ?? '', ]; return $selfParams; diff --git a/src/Gateways/Wechat/Refund.php b/src/Gateways/Wechat/Refund.php index 55eaec2d..38d023de 100644 --- a/src/Gateways/Wechat/Refund.php +++ b/src/Gateways/Wechat/Refund.php @@ -52,8 +52,8 @@ protected function getSelfParams(array $requestParams) $refundFee = bcmul($requestParams['refund_fee'], 100, 0); $selfParams = [ 'transaction_id' => $requestParams['transaction_id'] ?? '', - 'out_trade_no' => $requestParams['out_trade_no'] ?? '', - 'out_refund_no' => $requestParams['out_refund_no'] ?? '', + 'out_trade_no' => $requestParams['trade_no'] ?? '', + 'out_refund_no' => $requestParams['refund_no'] ?? '', 'total_fee' => $totalFee, 'refund_fee' => $refundFee, 'refund_fee_type' => self::$config->get('fee_type', 'CNY'), diff --git a/src/Gateways/Wechat/RefundQuery.php b/src/Gateways/Wechat/RefundQuery.php index 31318b66..a79d2987 100644 --- a/src/Gateways/Wechat/RefundQuery.php +++ b/src/Gateways/Wechat/RefundQuery.php @@ -50,8 +50,8 @@ protected function getSelfParams(array $requestParams) { $selfParams = [ 'transaction_id' => $requestParams['transaction_id'] ?? '', - 'out_trade_no' => $requestParams['out_trade_no'] ?? '', - 'out_refund_no' => $requestParams['out_refund_no'] ?? '', + 'out_trade_no' => $requestParams['trade_no'] ?? '', + 'out_refund_no' => $requestParams['refund_no'] ?? '', 'refund_id' => $requestParams['refund_id'] ?? '', 'offset' => $requestParams['offset'] ?? '', ]; diff --git a/src/Gateways/Wechat/Settlement.php b/src/Gateways/Wechat/Settlement.php index 2e63782b..c91e4e1b 100644 --- a/src/Gateways/Wechat/Settlement.php +++ b/src/Gateways/Wechat/Settlement.php @@ -87,7 +87,7 @@ protected function getSelfParams(array $requestParams) $selfParams = [ 'bill_date' => $requestParams['bill_date'] ?? '', 'account_type' => $requestParams['bill_type'] ?? 'Operation', - 'tar_type' => $requestParams['tar_type'] ?? '', + //'tar_type' => $requestParams['tar_type'] ?? '', ]; return $selfParams; diff --git a/src/Gateways/Wechat/TradeQuery.php b/src/Gateways/Wechat/TradeQuery.php index 9db5ad9d..4e37392d 100644 --- a/src/Gateways/Wechat/TradeQuery.php +++ b/src/Gateways/Wechat/TradeQuery.php @@ -50,7 +50,7 @@ protected function getSelfParams(array $requestParams) { $selfParams = [ 'transaction_id' => $requestParams['transaction_id'] ?? '', - 'out_trade_no' => $requestParams['out_trade_no'] ?? '', + 'out_trade_no' => $requestParams['trade_no'] ?? '', ]; return $selfParams; diff --git a/src/Gateways/Wechat/Transfer.php b/src/Gateways/Wechat/Transfer.php index 5092b0ca..060fe43e 100644 --- a/src/Gateways/Wechat/Transfer.php +++ b/src/Gateways/Wechat/Transfer.php @@ -57,7 +57,7 @@ protected function getSelfParams(array $requestParams) 're_user_name' => $requestParams['re_user_name'] ?? '', 'amount' => $totalFee, 'desc' => $requestParams['desc'] ?? '', - 'spbill_create_ip' => $requestParams['spbill_create_ip'] ?? '', + 'spbill_create_ip' => $requestParams['client_ip'] ?? '', ]; return $selfParams;