【类 型】:

【主	题】:
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-28 12:27:17 +08:00
parent a02a92d199
commit 1473a1a555

View File

@ -77,10 +77,11 @@ class PayController extends PublicController
exit(); exit();
} }
// 设置退款参数 // 设置退款参数
$refundParameter = [ $refundParameter = [
'out_trade_no' => $order['order_sn'], // 商户订单号 'out_trade_no' => $order['order_sn'], // 商户订单号
'out_refund_no' => $order['order_sn'] . '_refund', // 商户退款单号 'out_refund_no' => $order['order_sn'] . '_' . $_REQUEST['refund_type'], // 商户退款单号
'amount' => [ 'amount' => [
'refund' => $_REQUEST['refund_price'] * 100, // 退款金额,单位:分 'refund' => $_REQUEST['refund_price'] * 100, // 退款金额,单位:分
'total' => $order['total_price'] * 100, // 订单金额,单位:分 'total' => $order['total_price'] * 100, // 订单金额,单位:分
@ -106,7 +107,9 @@ class PayController extends PublicController
try { try {
// 实例化 Yansongda Pay 并处理回调 // 实例化 Yansongda Pay 并处理回调
$result = Pay::wechat($this->config)->callback(); $result = Pay::wechat($this->config)->callback();
$this->publish("demo", $result); $outRefundNo = $result['resource']['ciphertext']['out_refund_no'];
$refundType = substr($outRefundNo, strrpos($outRefundNo, '_'));
$this->publish("demo", $refundType);
// 验证成功,处理业务逻辑 // 验证成功,处理业务逻辑
if ($result['resource']['ciphertext']['refund_status'] == 'SUCCESS') { if ($result['resource']['ciphertext']['refund_status'] == 'SUCCESS') {