方法名 | 参数 | 返回值 |
---|---|---|
refund | array $order | Collection |
退款操作
$pay = new \fengkui\Pay\Unionpay($unionConfig);
$order = [
'refund_sn' => time(), // 商户退款单号
'refund_amount' => 1, // 退款金额
'query_id' => 'codexxxxxxxx', # 原始消费交易流水号(queryId)
];
$result = $pay->refund($order); // 执行退款
// 返回 Collection 实例包含退款相关信息
$type = true; // 是否为交易撤销 true 交易撤销,false 退款(默认)
$result = $pay->refund($order, $type); // 消费撤销(撤销时refund_amount需与支付金额相同)
退款请求参数
所有订单配置参数和官方无异,参数请参考这里,查看「请求参数」一栏。
返回示例
{
"accessType": "0",
"bizType": "000000",
"encoding": "UTF-8",
"merId": "777290058207330",
"orderId": "1718355058",
"origQryId": "192406140840544025268",
"queryId": "192406140850584041518",
"respCode": "00",
"respMsg": "成功[0000000]",
"signMethod": "01",
"txnAmt": "1",
"txnSubType": "00",
"txnTime": "20240614085058",
"txnType": "04",
"version": "5.1.0"
}