Browse Source

调整多次退款

master
wuliangbo 5 years ago
parent
commit
454d49fe27
  1. 8
      src/Payment/Refund/Client.php

8
src/Payment/Refund/Client.php

@ -18,15 +18,19 @@ class Client extends AppClient
* @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException * @throws \EasyAlipay\Kernel\Exceptions\InvalidSignException
* @throws \GuzzleHttp\Exception\GuzzleException * @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 = new AlipayTradeRefundContentBuilder();
$refundContentBuilder->setOutTradeNo($out_trade_no); $refundContentBuilder->setOutTradeNo($out_trade_no);
$refundContentBuilder->setRefundAmount($refund_amount); $refundContentBuilder->setRefundAmount($refund_amount);
$refundContentBuilder->setRefundReason($refund_reason);
if ($out_request_no) {
$refundContentBuilder->setOutRequestNo($out_request_no);
}
$request = new AppRequest (); $request = new AppRequest ();
$request->setBizContent($refundContentBuilder->getBizContent()); $request->setBizContent($refundContentBuilder->getBizContent());
$request->setApiMethodName("alipay.trade.refund"); $request->setApiMethodName("alipay.trade.refund");
return($this->execute($request)) ; return ($this->execute($request));
} }
} }

Loading…
Cancel
Save