fix(payment): parse money field in EasyPay webhook, cancel button text

- EasyPay VerifyNotification was not parsing the 'money' field, causing
  Amount=0 in PaymentNotification → amount mismatch error on callback
- Cancel button on QR page now shows "取消订单" instead of generic "取消"
This commit is contained in:
erio
2026-04-07 11:01:32 +08:00
parent 56dbbabf1c
commit 011ca6da93
4 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -12,6 +12,7 @@ import (
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
@@ -186,9 +187,10 @@ func (e *EasyPay) VerifyNotification(_ context.Context, rawBody string, _ map[st
if params["trade_status"] == "TRADE_SUCCESS" {
status = "success"
}
amount, _ := strconv.ParseFloat(params["money"], 64)
return &payment.PaymentNotification{
TradeNo: params["trade_no"], OrderID: params["out_trade_no"],
Status: status, RawData: rawBody,
Amount: amount, Status: status, RawData: rawBody,
}, nil
}
+1
View File
@@ -5086,6 +5086,7 @@ export default {
expiresIn: 'Expires in',
expired: 'Order Expired',
waitingPayment: 'Waiting for payment...',
cancelOrder: 'Cancel Order',
},
orders: {
title: 'My Orders',
+1
View File
@@ -5283,6 +5283,7 @@ export default {
expiresIn: '剩余支付时间',
expired: '订单已过期',
waitingPayment: '等待支付...',
cancelOrder: '取消订单',
},
orders: {
title: '我的订单',
@@ -16,7 +16,7 @@
</div>
<!-- Cancel button -->
<button v-if="!expired && orderId" class="btn btn-secondary w-full" :disabled="cancelling" @click="handleCancel">
{{ cancelling ? t('common.processing') : t('common.cancel') }}
{{ cancelling ? t('common.processing') : t('payment.qr.cancelOrder') }}
</button>
</div>
</AppLayout>