feat(payment): implement coffee tip plans and update payment flow

This commit is contained in:
2026-07-14 11:48:46 +08:00
parent f9c15bd91f
commit 3a4f24cb06
30 changed files with 632 additions and 56 deletions
+3 -3
View File
@@ -21,15 +21,15 @@ describe("tip coffee configuration", () => {
it("provides the configured plan and fallback price for each type", () => {
expect(getTipCoffeeOption("small")).toMatchObject({
amountCents: 499,
planId: "tip_coffee_small",
planId: "tip_coffee_usd_4_99",
});
expect(getTipCoffeeOption("medium")).toMatchObject({
amountCents: 999,
planId: "tip_coffee_medium",
planId: "tip_coffee_usd_9_99",
});
expect(getTipCoffeeOption("large")).toMatchObject({
amountCents: 1999,
planId: "tip_coffee_large",
planId: "tip_coffee_usd_19_99",
});
});
+3 -3
View File
@@ -17,19 +17,19 @@ const TIP_COFFEE_OPTIONS: Record<TipCoffeeType, TipCoffeeOption> = {
type: "small",
amountCents: 499,
fallbackName: "Small Coffee",
planId: "tip_coffee_small",
planId: "tip_coffee_usd_4_99",
},
medium: {
type: "medium",
amountCents: 999,
fallbackName: "Medium Coffee",
planId: "tip_coffee_medium",
planId: "tip_coffee_usd_9_99",
},
large: {
type: "large",
amountCents: 1999,
fallbackName: "Large Coffee",
planId: "tip_coffee_large",
planId: "tip_coffee_usd_19_99",
},
};