feat(payment): sync plans and add coins rules

This commit is contained in:
2026-06-29 14:11:50 +08:00
parent 274fe87ced
commit e372d58b4c
24 changed files with 1099 additions and 224 deletions
+34
View File
@@ -0,0 +1,34 @@
GET https://proapi.banlv-ai.com/api/payment/plans
结果:
status=200
success=true
plans 数量 8
VIP 套餐 3 个
credits 套餐 5 个
snake_keys=[],已经没有 plan_id / amount_cents 这种字段
schema 校验通过:proapi_plans_camel_schema_ok true
前端按这个结构用:
type PaymentPlan = {
planId: string;
planName: string;
orderType: 'vip_monthly' | 'vip_quarterly' | 'vip_annual' | 'dol';
vipDays: number | null;
dolAmount: number | null;
creditBalance: number;
amountCents: number;
originalAmountCents: number | null;
dailyPriceCents: number | null;
currency: string;
};
分组:
const plans = res.data.plans;
const vipPlans = plans.filter(p => p.vipDays !== null);
const creditPlans = plans.filter(p => p.dolAmount !== null);
下单仍然传 planId
{
"planId": "vip_monthly",
"payChannel": "stripe",
"autoRenew": true
}
价格、币种全部以前端拿到的 amountCents / currency 展示,不要写死。当前我这边访问 pro 返回的是 JPY,这是 Cloudflare 根据访问 IP 判的国家币种。