Ghost/ghost/members-importer/test
Kevin Ansfield ae1ac83fc5
Fixed members import-with-tier alpha creating unexpected invoices (#20695)
ref https://linear.app/tryghost/issue/ONC-199

The `updateSubscriptionItemPrice()` method in our Stripe library used by the importer when moving a subscription over to a Ghost product/price was setting `proration_behavior: 'always_invoice'`. This resulted in invoices being created when changing the subscription (even though no prices were changing as far as the customer is concerned) and in some cases where a customer previously had a one-off discount the customer was incorrectly charged the proration difference because the discount was no longer applied to the new invoice.

- updated `updateSubscriptionItemPrice()` to accept an `options` param allowing the `proration_behavior` property passed to the Stripe API to be overridden on a per-call basis
- updated the `forceStripeSubscriptionToProduct()` method used by the importer to pass an options object with `prorationBehavior: 'none'` when updating the subscription item price so that no invoice and no unexpected charges occur when importing
2024-07-31 11:16:25 +01:00
..
fixtures 🐛 Fixed members import unsubscribing members when subscribe_to_emails is empty (#19658) 2024-02-06 10:19:16 -08:00
utils Initialized members-importer package 2021-07-22 01:53:21 +12:00
.eslintrc.js Initialized members-importer package 2021-07-22 01:53:21 +12:00
index.test.js Implement member import with tier (#17506) 2023-08-18 15:24:31 +01:00
MembersCSVImporter.test.js 🐛 Fixed members importer overwriting name and note if left blank (#19663) 2024-02-06 13:31:34 -08:00
MembersCSVImporterStripeUtils.test.js Fixed members import-with-tier alpha creating unexpected invoices (#20695) 2024-07-31 11:16:25 +01:00