From 454d49fe274372d3d52656d451be2b3b76d49643 Mon Sep 17 00:00:00 2001 From: wuliangbo Date: Fri, 3 Apr 2020 11:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=9A=E6=AC=A1=E9=80=80?= =?UTF-8?q?=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Payment/Refund/Client.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Payment/Refund/Client.php b/src/Payment/Refund/Client.php index fa77156..ed39d01 100755 --- a/src/Payment/Refund/Client.php +++ b/src/Payment/Refund/Client.php @@ -18,15 +18,19 @@ class Client extends AppClient * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException * @throws \GuzzleHttp\Exception\GuzzleException */ - public function refund(string $out_trade_no,string $refund_amount) + public function refund(string $out_trade_no, string $refund_amount, string $refund_reason = '订单退款', string $out_request_no = '') { //构造查询业务请求参数对象 $refundContentBuilder = new AlipayTradeRefundContentBuilder(); $refundContentBuilder->setOutTradeNo($out_trade_no); $refundContentBuilder->setRefundAmount($refund_amount); + $refundContentBuilder->setRefundReason($refund_reason); + if ($out_request_no) { + $refundContentBuilder->setOutRequestNo($out_request_no); + } $request = new AppRequest (); $request->setBizContent($refundContentBuilder->getBizContent()); $request->setApiMethodName("alipay.trade.refund"); - return($this->execute($request)) ; + return ($this->execute($request)); } }