feat: 添加 GPC Helper API URL 支持并更新相关逻辑

This commit is contained in:
QLHazyCoder
2026-05-05 05:32:01 +08:00
parent 6056a94d91
commit 3dfc112561
10 changed files with 49 additions and 28 deletions
+6
View File
@@ -23,6 +23,12 @@ test('GoPay utils keeps GPC helper payment method distinct', () => {
test('GoPay utils builds GPC card balance URL from helper endpoints', () => {
const api = loadGoPayUtils();
assert.equal(api.DEFAULT_GPC_HELPER_API_URL, 'https://gopay.hwork.pro');
assert.equal(api.normalizeGpcHelperBaseUrl(''), 'https://gopay.hwork.pro');
assert.equal(
api.buildGpcHelperApiUrl('', '/api/checkout/start'),
'https://gopay.hwork.pro/api/checkout/start'
);
assert.equal(
api.buildGpcCardBalanceUrl('http://localhost:18473/', ' card key/1 '),
'http://localhost:18473/api/card/balance?card_key=card%20key%2F1'