- Remove check to only send emails for subscriptions that are billed on a "day" or "month" based interval
Because:
- We now want to support a wider variety of subscription billing intervals for our products being offered
Fixes: https://github.com/mozilla/fxa/issues/4940
Update recurring charge payload to support a prorated charge
- Add proration_amount and total_amount to recurring payments payload to Basket/SF
- Update tests related to recurring charges
Corrected the following:
- Subscriptions definition was broken out to be a list of a defined Subscription
- Updates to definitions enabled response validator to work as expected.
Implement new payload for processing upgrades
The basket payload should include the following information, per this API spec:
event_id - The Stripe Event ID
event_type - customer.subscription.upgrade OR customer.subscription.downgrade
close_date - Date that the event occurs (when the customer makes the change to their subscription)
customer_id - The Stripe Customer ID
nickname_old - This is created from the old Product name and the old Plan interval
nickname_new - This is created from the new Product name and the new Product interval
plan_amount_old - This is the price of the old Plan
plan_amount_new - This is the price of the new Plan
proration_amount - Use the upcoming invoice API to retrieve the prorated amount to provide. It will be calculated by summing together the line item amounts found within the Invoice object https://stripe.com/docs/api/invoices/object
interval - This is the interval for the new Plan
current_period_end - Billing cycle end date; this will populate the {NextInvoiceDate}
in the email body for reactivated subscriptions
subscription_id - Subscription id - so we can group charges for a specific subscription
invoice_number - Invoice Number (customer facing value, to be included on the customer's invoice sent via email)
invoice_id - Unique identifier of the invoice from Stripe
Card type is not capitalized in receipt emails
- Get correct brand value to send to Salesforce
- Add tests to cover new code for format branding
- Fix tests that required adjustments for branding changes