You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
namespace fubei\pay ;
use fubei\Base ;
class Refund extends Base
{
/**
* 退款
* @param string $fubei_order_number 请求付呗的订单编号
* @param string $refund_number 商户退款单号,自己生成用于自己识别即可
* @param float $refund_money 订单退款金额
* @remark 支持90天内的订单退款
* @remark 23: 50 - 00: 00 不允许退款
* @date 2021-11-23
*/
public function refund ( $fubei_order_number , $refund_number , $refund_money = 0 )
{
//公共参数
$common_data = [
'method' => 'fbpay.order.refund' ,
];
//业务参数
$biz_content = [
'merchant_order_sn' => $fubei_order_number ,
'merchant_refund_sn' => $refund_number ,
'refund_amount' => ( string ) round ( $refund_money , 2 ), //退款金额, 精确到0.01,注:使用优惠券时仅支持全额退款
];
$result = $this -> actionApi ( $common_data , $biz_content );
// 记录日志
$uid = defined ( 'UID' ) ? UID : '' ;
platformLog ([
'common_data' => $common_data ,
'biz_content' => $biz_content ,
], $result , 'fubei_refund_uid_' . $uid );
return $result ;
}
}