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)); } }