Skip to content

Commit 46a6b73

Browse files
authored
Merge pull request #18803 from mozilla/fxa-11540-add-missing-metadata
fix(next): missing metadata on upgrade
2 parents c299ba0 + 1561289 commit 46a6b73

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

libs/payments/cart/src/lib/checkout.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,10 @@ export class CheckoutService {
522522
// Note: These fields are due to missing Fivetran support on Stripe multi-currency plans
523523
[STRIPE_SUBSCRIPTION_METADATA.Amount]: cart.amount,
524524
[STRIPE_SUBSCRIPTION_METADATA.Currency]: cart.currency,
525+
[STRIPE_SUBSCRIPTION_METADATA.PreviousPlanId]: fromPriceId,
526+
[STRIPE_SUBSCRIPTION_METADATA.PlanChangeDate]: Math.floor(
527+
Date.now() / 1000
528+
),
525529
},
526530
});
527531
}

libs/payments/customer/src/lib/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export enum STRIPE_SUBSCRIPTION_METADATA {
4848
Currency = 'currency',
4949
Amount = 'amount',
5050
SubscriptionPromotionCode = 'appliedPromotionCode',
51+
PreviousPlanId = 'previous_plan_id',
52+
PlanChangeDate = 'plan_change_date',
5153
}
5254

5355
export enum STRIPE_INVOICE_METADATA {

0 commit comments

Comments
 (0)