0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/ghost/stripe
Sag bd20ad3adb
🐛 Fixed missing subscription attribution on free to paid upgrade (#21846)
closes https://linear.app/ghost/issue/ENG-1561

- problem: When a free member upgraded to paid, we sometimes did not
capture the subscription attribution data

- cause:
    - after checkout, Stripe sends `customer.subscription.created`,
`customer.subscription.updated` and `checkout.session.completed` webhook
events
    - we want to create a subscription in our database based on the
`checkout.session.completed` event, as it contains additional data (e.g.
subscription attribution data)
    - but, we were sometimes creating a subscription based on a
`customer.subscription.*` event during free → paid upgrades, which did
not contain subscription attribution data

- solution: we now ignore `customer.subscription.*` events until a
member and its related subscription have been created in the database
first, by the `checkout.session.completed` event
2024-12-11 02:49:28 +00:00
..
lib 🐛 Fixed missing subscription attribution on free to paid upgrade (#21846) 2024-12-11 02:49:28 +00:00
test 🐛 Fixed missing subscription attribution on free to paid upgrade (#21846) 2024-12-11 02:49:28 +00:00
.eslintrc.js
index.js Expose Stripe events in package 2023-06-14 08:18:19 -04:00
package.json Update TryGhost packages 2024-08-05 12:12:34 +02:00