作者 wangzhi

修改

... ... @@ -414,7 +414,7 @@ class Api
public function Tuikuan($OrderSn)
{
$PayOrderInfo = Db::name('pay_order')->where('OrderSn', $OrderSn)->where('type', 1)->find();
$TuiMoney = $PayOrderInfo['money'];
dump($PayOrderInfo);
//配置
$config = [
'app_id' => 'wx6a9080f20326f817',
... ... @@ -428,7 +428,7 @@ class Api
$app = new Application($config);
$payment = $app->payment;
try {
$result = $payment->refundByTransactionId($PayOrderInfo['WeChatOrder'], $PayOrderInfo['PayOrder'], $PayOrderInfo['money'] * 100, $TuiMoney*100); // 总金额 100, 退款 80,操作员:商户号
$result = $payment->refundByTransactionId($PayOrderInfo['WeChatOrder'], $PayOrderInfo['PayOrder'], $PayOrderInfo['money'] * 100, $PayOrderInfo['money'] * 100); // 总金额 100, 退款 80,操作员:商户号
//更改订单状态为已退款
Db::name('pay_order')->where('OrderSn', $OrderSn)->where('PayOrder', $PayOrderInfo['PayOrder'])->update(['type' => 0]);
} catch (Exception $e) {
... ...