Closed pr4xx closed 3 years ago
FYI: haven't gotten to this yet but hoping to check into this on Thursday or Friday.
I didn't get to this yet sorry... I'll try to next week!
I can't reproduce this on the latest version sorry. I can swap plans just fine and the existing subscription record is updated as well as its related subscription item record.
Damn, I tried again just yet and it did not work again. I did the following:
I can see the webhook in the terminal (stripe cli).
But my subscriptions
table has not changed at all.
Do you have a guess where the info gets lost?
When inspecting the payload of the webhook coming from stripe you can see the previous_attributes
field. As fas as I understand that contains the info about the old plan etc. But I cannot find any place in cashier-stripe
where previous_attributes
gets handled.
Hmm we indeed don't use the previous_attributes
at all because we don't need it. We just sync back the existing subscription into the database.
Can you maybe set up a test repo with the minimum amount of code that's needed to reproduce this? Please commit your custom changes separately from the skeleton. And note in the readme how you set up your products/prices etc.
Description:
It seems like the
handleCustomerSubscriptionUpdated
method is not yet able to handle down/upgrade of plans. I am using the stripe billing portal and enabled the option that customers can change plans. I got confused that my app still stated that I am on planB
besides me switching to planA
. After looking into the payload of thecustomer.subscription.updated
webhook, I seems to me that the keyprevious_attributes
in the json is ignored / not yet handled. Here is the json of the webhook: customer_subscription_updated.txtSteps To Reproduce: