币商充值增加C2C选项

This commit is contained in:
zhx 2026-07-14 16:34:08 +08:00
parent e021c51500
commit 26f8d0767f
2 changed files with 12 additions and 5 deletions

View File

@ -22,6 +22,7 @@ export const COIN_SELLER_RECHARGE_PROVIDERS = [
]; ];
export const COIN_SELLER_RECHARGE_CHAINS = [ export const COIN_SELLER_RECHARGE_CHAINS = [
["C2C", "C2C"],
["TRON", "TRON"], ["TRON", "TRON"],
["BSC", "BSC"], ["BSC", "BSC"],
]; ];

View File

@ -107,6 +107,13 @@ test("builds validates and normalizes coin seller recharge orders", () => {
providerCurrencyCode: "PHP", providerCurrencyCode: "PHP",
usdAmount: 10.5, usdAmount: 10.5,
}); });
expect(
buildCoinSellerRechargeReceiptPayload({
...payload,
chain: "c2c",
providerCode: "usdt",
}),
).toMatchObject({ chain: "C2C", providerCode: "usdt" });
expect(validateCoinSellerRechargeOrderPayload(payload)).toBe(""); expect(validateCoinSellerRechargeOrderPayload(payload)).toBe("");
expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerCurrencyCode: "" })).toBe("请填写币种"); expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerCurrencyCode: "" })).toBe("请填写币种");
expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerAmountMinor: 0 })).toBe( expect(validateCoinSellerRechargeOrderPayload({ ...payload, providerAmountMinor: 0 })).toBe(
@ -228,7 +235,9 @@ test("builds validates and normalizes coin seller recharge orders", () => {
}); });
test("builds coin seller recharge quotes and validates exchange rate config", () => { test("builds coin seller recharge quotes and validates exchange rate config", () => {
expect(buildCoinSellerRechargeQuotePayload({ appCode: " lalu ", targetUserId: " 123456 ", usdAmount: "150" })).toEqual({ expect(
buildCoinSellerRechargeQuotePayload({ appCode: " lalu ", targetUserId: " 123456 ", usdAmount: "150" }),
).toEqual({
appCode: "lalu", appCode: "lalu",
targetUserId: "123456", targetUserId: "123456",
usdAmount: 150, usdAmount: 150,
@ -251,10 +260,7 @@ test("builds coin seller recharge quotes and validates exchange rate config", ()
expect( expect(
validateCoinSellerRechargeExchangeRatePayload({ validateCoinSellerRechargeExchangeRatePayload({
...payload, ...payload,
tiers: [ tiers: [payload.tiers[0], { minUsdAmount: 200, maxUsdAmount: 300, coinsPerUsd: 90000 }],
payload.tiers[0],
{ minUsdAmount: 200, maxUsdAmount: 300, coinsPerUsd: 90000 },
],
}), }),
).toBe("USD 金额区间不能重叠"); ).toBe("USD 金额区间不能重叠");
}); });