#Jogui-subscriptions

1 messages · Page 1 of 1 (latest)

ruby sedge
#

Hi! Happy to hear that you Stripe implementation is working!
Can you clarify what you mean by:

in some cases this event is sent before the user pays the renewal of the subscription, making the subscription Stripe Object not show the new subscription period, but the old one.
Can you share an event ID where you saw this?

sleek oracle
#

Yes for sure I clarify: checking our implementation, we are using "customer.subscription.updated" and not ""payment_intent.succeeded" or " "invoice.paid" to detect when a user completes the payment of the renewal of the subscription

#

now auditing the first renewals in our system in production, we have checked that in our internal User object, those users don't have the subscription dates after the renewal

#

but in stripe they have the correct new susbcription end dates, because the renewal has been succeeded

#

checking our logs and such, we see that when we receive the event of "customer.subscription.updated", the customer, our user, had not the renewal completed, and therefore, on our end, that user has not renewed to the next period/iteration of the subscription (for example, 1 year more of service for an anual plan)

ruby sedge
sleek oracle
#

sure, let me search for it, one moment please

#

This one, for example.

#

But now checking our code, maybe there's some incorrect logic, as checking the raw event data, the dateEnd is the correct, new one.

#

yes I found it, on customer.subscription.updated we check if the last_invoice is paid, in the moment we receive this event, the subscription has been updated, but the invoice has not already been paid, and therefore we don't update the dates

#

as it's an expendable field (Invoice from Subscription), now debuging, the Invoice status is paid, but it wasn't in the moment of the real reception of the event

#

that's it, we need to use invoice.paid