feat(tip): add coffee tipping page
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user