feat(tip): add coffee tipping page

This commit is contained in:
2026-07-08 19:21:42 +08:00
parent c1aba64573
commit cb7791dd8d
14 changed files with 1224 additions and 4 deletions
@@ -12,4 +12,13 @@ describe("pending payment order helpers", () => {
}),
).toBe("/subscription?type=topup&payChannel=ezpay&paymentReturn=1&returnTo=chat");
});
it("routes tip payments back to the tip page", () => {
expect(
buildPendingPaymentSubscriptionUrl({
payChannel: "ezpay",
subscriptionType: "tip",
}),
).toBe("/tip?payChannel=ezpay&paymentReturn=1");
});
});
+8
View File
@@ -48,6 +48,14 @@ export function buildPendingPaymentSubscriptionUrl(
"payChannel" | "returnTo" | "subscriptionType"
>,
): string {
if (order.subscriptionType === "tip") {
const params = new URLSearchParams({
payChannel: order.payChannel,
paymentReturn: "1",
});
return `${ROUTES.tip}?${params.toString()}`;
}
const params = new URLSearchParams({
type: order.subscriptionType,
payChannel: order.payChannel,