mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -5086,6 +5086,7 @@ export default {
|
||||
expiresIn: 'Expires in',
|
||||
expired: 'Order Expired',
|
||||
waitingPayment: 'Waiting for payment...',
|
||||
cancelOrder: 'Cancel Order',
|
||||
},
|
||||
orders: {
|
||||
title: 'My Orders',
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user