方法名 | 参数 | 返回值 |
---|---|---|
refund | array $order | Collection |
退款操作
$pay = new \fengkui\Pay\Alipay($alipayConfig);
$refund = [
'refund_sn' => time(), // 商户退款单号
'refund_amount' => 1, // 退款金额
'order_sn' => 'ordersnxxxxxxxx', # 商户订单号(order_sn或trade_no两者必传其一)
'trade_no'=> 'tradenoxxxxxxxx', // 支付宝支付订单号
];
$result = $pay->refund($refund);
// 返回 Collection 实例包含退款相关信息
// $order['reason'] // 退款原因选填
退款请求参数
所有订单配置参数和官方无异,参数请参考这里,查看「业务请求参数」一栏。
退款返回参数
相关返回参数说明,请参考这里,查看「业务返回参数」一栏。
返回示例
{
"alipay_trade_refund_response": {
"code": "10000",
"msg": "Success",
"trade_no": "支付宝交易号",
"out_trade_no": "6823789339978248",
"buyer_logon_id": "159****5620",
"fund_change": "Y",
"refund_fee": 88.88,
"refund_detail_item_list": [
{
"fund_channel": "ALIPAYACCOUNT",
"amount": 10,
"real_amount": 11.21,
"fund_type": "DEBIT_CARD"
}
],
"store_name": "望湘园联洋店",
"buyer_user_id": "2088101117955611",
"send_back_fee": "1.8",
"refund_hyb_amount": "10.24",
"refund_charge_info_list": [
{
"refund_charge_fee": 0.01,
"switch_fee_rate": "0.01",
"charge_type": "trade",
"refund_sub_fee_detail_list": [
{
"refund_charge_fee": 0.1,
"switch_fee_rate": "0.01"
}
]
}
]
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}