#brookflok_webhooks
1 messages · Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- brookflok_best-practices-account-support, 2 hours ago, 10 messages
- brookflok_best-practices-account-support, 2 days ago, 8 messages
- brookflok_adaptive-pricing-checkout, 4 days ago, 43 messages
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1240413454431424623
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
So I have an app with subscription and it has packages
The user can change the package, the can upgrade and downgrade
when he downgrades, his downgrade will hapen when the current subscription ends
And I can do that with subscription schedules
I think there might be a fundamental misunderstanding here. No new subscription is created during normal downgrades/upgrades
Where are you checking the invoice_billing_reason ?
Okay, so I will explain it to you
just a second
Didn't have the space in the Question
So I have 3 packages for the users and they can be monhly and yearly so basically I have 6 packages.
And the user can subscribe to a yearly package and he can chose to downgrade to a monthly plan.
He will first use his yearly package, and then downgrade to the monthly payment.
To achieve this I take the subscription and put it to { cancel_at_period_end: true }
and then schedule a new subscription that will start when this subscription ends
I will be able to track when the old subscription ends with subscription_schedule.canceled
then I will be able to track the new subscription with
subscription_schedule.released
and then the user will have to pay for the new released subscription
and then it will trigger invoice.paid
invoce data.object contains $invoice->billing_reason;
and when I have a new subscription it is subscription_create
but when I make a new cycle payment
it is subscription_cycle
Now I'm interested what biling_reason will it be in this case, so I can update my user when he pays for the subscription
That seems like a fairly complex billing scenario, so I'm not sure what the billing reason would be. I would recommend having a test set up with Test Clocks so you can try different configurations: https://docs.stripe.com/billing/testing/test-clocks
Okay, but what would be the aproach to this maybe without the billing_reason
I was thinking when subscription_schedule.released happens that the user paid for the subscription
but it doesn’t say it anywhere so I asume it is not
So I guess the only way to know did the user pay is to get the webhook for the payment
I'm not sure I understand the question
So you understand the billing_reason idea?
I ask you if there is some other way how to track that the user has paid for the new subscription that was scheduled
You could listen for invoice.paid webhook Events. That's usually how people check the status of a Subscription payment
Yes, but I have diferent cases, that I check with billing_reason but because you don't know that, I was thinking maybe there is some other way to know for the scheduled subscription payment
Not really. Webhooks are the recommended path to success for that
As you can se I use them
and I get the billing_reason from the $invoice
Just have it setup for subscription_create, subscription_cycle, subscription_update and wanted to set the new subscription before it
and was asking is there some way I can know that it is a scheduled subscription that was released
I'm sorry, it's really difficult to understand what you're actually asking
Sorry I couldn't be more helpful! Best of luck all the same