feat(payment): expand Stripe methods and checkout handoff
Docker Image / Build and Push Docker Image (push) Successful in 2m10s
Docker Image / Build and Push Docker Image (push) Successful in 2m10s
This commit is contained in:
@@ -32,14 +32,18 @@ function initializeCatalogState(
|
||||
const catalogChanged = planCatalog !== context.planCatalog;
|
||||
const characterChanged = giftCharacterId !== context.giftCharacterId;
|
||||
const selectionChanged =
|
||||
planCatalog === "tip" &&
|
||||
((event.category ?? null) !== context.selectedGiftCategory ||
|
||||
(event.planId ?? null) !== (context.selectedPlanId || null));
|
||||
planCatalog === "tip"
|
||||
? (event.category ?? null) !== context.selectedGiftCategory ||
|
||||
(event.planId ?? null) !== (context.selectedPlanId || null)
|
||||
: (event.planId ?? null) !== (context.selectedPlanId || null);
|
||||
const commercialOfferId =
|
||||
planCatalog === "default" ? (event.commercialOfferId ?? null) : null;
|
||||
const offerChanged = commercialOfferId !== context.commercialOfferId;
|
||||
const chatActionId = event.chatActionId ?? null;
|
||||
const chatActionChanged = chatActionId !== context.chatActionId;
|
||||
const initialAutoRenew =
|
||||
planCatalog === "tip" ? false : (event.autoRenew ?? true);
|
||||
const autoRenewChanged = initialAutoRenew !== context.autoRenew;
|
||||
|
||||
return {
|
||||
planCatalog,
|
||||
@@ -51,7 +55,12 @@ function initializeCatalogState(
|
||||
planCatalog === "tip" ? (event.category ?? null) : null,
|
||||
requestedGiftPlanId:
|
||||
planCatalog === "tip" ? (event.planId ?? null) : null,
|
||||
...(catalogChanged || characterChanged || selectionChanged || offerChanged || chatActionChanged
|
||||
...(catalogChanged ||
|
||||
characterChanged ||
|
||||
selectionChanged ||
|
||||
offerChanged ||
|
||||
chatActionChanged ||
|
||||
autoRenewChanged
|
||||
? {
|
||||
...resetOrderState(),
|
||||
plans: [],
|
||||
@@ -62,7 +71,7 @@ function initializeCatalogState(
|
||||
planCatalog === "default" ? (event.planId ?? "") : "",
|
||||
isFirstRecharge: false,
|
||||
commercialOffer: null,
|
||||
autoRenew: planCatalog !== "tip",
|
||||
autoRenew: initialAutoRenew,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user