feat(payment): implement coffee tip plans and update payment flow
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
paidVoiceHistoryResponse,
|
||||
paidPaymentOrderStatusResponse,
|
||||
paymentPlansResponse,
|
||||
tipPaymentPlansResponse,
|
||||
refreshedEmailLoginResponse,
|
||||
refreshedGuestLoginResponse,
|
||||
userEntitlementsResponse,
|
||||
@@ -189,6 +190,10 @@ export async function mockCoreApis(
|
||||
await route.fulfill({ json: apiEnvelope(paymentPlansResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/payment/tip-plans**", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(tipPaymentPlansResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/payment/create-order", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(createPaymentOrderResponse) });
|
||||
});
|
||||
|
||||
@@ -336,6 +336,47 @@ export const paymentPlansResponse = {
|
||||
],
|
||||
};
|
||||
|
||||
export const tipPaymentPlansResponse = {
|
||||
plans: [
|
||||
{
|
||||
planId: "tip_coffee_usd_4_99",
|
||||
planName: "Small Coffee",
|
||||
orderType: "tip",
|
||||
tipType: "coffee_small",
|
||||
description: "Buy Elio a small coffee",
|
||||
amountCents: 499,
|
||||
currency: "USD",
|
||||
autoRenew: false,
|
||||
isFirstRechargeOffer: false,
|
||||
firstRechargeDiscountPercent: 0,
|
||||
},
|
||||
{
|
||||
planId: "tip_coffee_usd_9_99",
|
||||
planName: "Medium Coffee",
|
||||
orderType: "tip",
|
||||
tipType: "coffee_medium",
|
||||
description: "Buy Elio a medium coffee",
|
||||
amountCents: 999,
|
||||
currency: "USD",
|
||||
autoRenew: false,
|
||||
isFirstRechargeOffer: false,
|
||||
firstRechargeDiscountPercent: 0,
|
||||
},
|
||||
{
|
||||
planId: "tip_coffee_usd_19_99",
|
||||
planName: "Large Coffee",
|
||||
orderType: "tip",
|
||||
tipType: "coffee_large",
|
||||
description: "Buy Elio a large coffee",
|
||||
amountCents: 1999,
|
||||
currency: "USD",
|
||||
autoRenew: false,
|
||||
isFirstRechargeOffer: false,
|
||||
firstRechargeDiscountPercent: 0,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const paymentOrderId = "order_e2e_vip_monthly";
|
||||
|
||||
export const createPaymentOrderResponse = {
|
||||
|
||||
Reference in New Issue
Block a user