#samip_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1290918209821868062
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- samip_api, 1 day ago, 77 messages
Hi, I faced a similar problem yesterday.
https://discord.com/channels/841573134531821608/1290475717636915221
That turned out to be a bit different and turns out I just needed an update. But I think for this use case subscription schedules are recommended, but I cannot get them to work . Can you please help me out ?
Customer ID : cus_QxG7EsOvgIaBAB
I'm checking how your subscription schedule was integrated
Thank you.
In https://dashboard.stripe.com/test/subscriptions/sub_1Q5LbzGei7MrDZaxWZEnIVLO,
- the first phase had the price price_1PxMd8Gei7MrDZax9WHaKb88 of $99 that the first invoice amount was correct: https://dashboard.stripe.com/test/invoices/in_1Q5LbzGei7MrDZax45IJ8g20
In https://dashboard.stripe.com/test/events/evt_1Q5LemGei7MrDZaxyT5EAJ5B, the subscription schedule was canceled due to delinquency: https://docs.stripe.com/billing/subscriptions/webhooks#:~:text=Sent when a subscription schedule is canceled because payment delinquency terminated the related subscription.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This is the reason why subscription won't be updated to $29 in the upcoming cycles
Is there a way I can avoid that ?
I want the subscription schedule to do a change over instead
I am using the 4242 card from Stripe so the payment shouldn't fail right ?
4242 card wasn't set to the default payment method on the customer, so invoice payment failed due to missing payment method.
To charge the customer from the saved payment method, the payment method should be set to his/her default by setting payment method to invoice_settings.default_payment_method on Customer: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
Can I grab the default payment method from here and attach it to the subscription schedule ? https://docs.stripe.com/api/payment_methods/customer_list
Or do I need to update the customer separately as per the link you've provided and then proceed to create the subscription schedule.
Also, I believe I need to attach it on the second phase only right ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can I grab the default payment method from here and attach it to the subscription schedule ?
Yes! This will work too
You can set the default payment method to one of them:
invoice_settings.default_payment_methodon Customerdefault_payment_methodon Subscriptionphases.default_payment_methodon the Subscription Schedule
Also, I believe I need to attach it on the second phase only right ?
Yes! I'd recommend testing out in test mode
Can you please leave this thread alive until then ? I will do a quick test by attaching it to the phases in subscription schedule
We keep threads short lived but it'll stay open for ~30 minutes. If it's closed, you can ask a new question!
Thanks, will do
req_wb3iYbzg05RGec
When I advance the test clock, I see two payments for $99 go through on the same date but not the new one ๐ค
This does not look correct (Please see attached image).
I expect the customer to be charged $99 once on 2nd of October (as I started paying to plan on the 2nd of october)
Then , on the 2nd of November, I want them to be charged $29 because they've downgraded.
Any further charges should only ever be $29.
However, I am getting charged twice on 2nd october and twice on 2nd November (albiet it's got a diffrent price)
And the customer portal still has this scheduled subscription, I thought it'd be replaced since end_behaviour is release ?
In https://dashboard.stripe.com/test/subscriptions/sub_1Q5MAcGei7MrDZaxBZmq8P7B where the subscription schedule created sub_1Q5MAcGei7MrDZaxBZmq8P7B, the invoices look correct to me.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
First invoice was $99 and the subsequent ones were $29
Yes, it does ๐ค
However, if you'd pull up this customer cus_QxGgN1yWp76UhU . You'll see that 4 payments has been taken out from the account . It should only be 2 ($99 and $29) and there should no longer be a subscription schedule instead a new subscription on the account with the previous one marked as canceled?
Even the recent activity indicates that the customer is being charged , $99 twice ?
There were two subscriptions created on this customer.
https://dashboard.stripe.com/test/logs/req_wb3iYbzg05RGec using Subscription Schedule created sub_1Q5MAcGei7MrDZaxBZmq8P7B which behaved correctly.
sub_1Q5M9eGei7MrDZax2nbaOzrn was created from a Checkout Session: https://dashboard.stripe.com/test/logs/req_xrYGYKj6O5lHWu
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Your system created two subscriptions on this customer
One through Checkout Session whereas another through Subscription Schedule
hmmm, maybe that's the bit that's wrong.
However, I want to use the same subscription from the checkout session. Is that possible ?
I want to modify this sub_1Q5M9eGei7MrDZax2nbaOzrn itself and not create a a new subscription as creating a new subscription will break other functionalities in my system.
Yes, that's possible. You can add a subscription schedule to an existing subscription. This is how you can do it: https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#changing-subscriptions
Sweet, let me try this. I will try this out and hopefully come back before the thread is inactive ๐
Sounds good!
Thank you
This is exactly what I wanted
However, I have a small question with this
For Customer ID : cus_QxH4XyCfWhRa83
Why does the subscription still say there is an update scheduled ? Did I miss passing a param for that ?
Request ID : req_u0nSXOcJzgEMXe
The subscription schedule will only be released after the last phase is ended
In your second phase with iteration: 1, its end date is 2024-12-02 06:59:14 UTC. Subscription schedule won't be released until the end date of the second phase is fully completed
This means that the subscription schedule will be released on 2024-12-02 06:59:14 UTC, which is one iteration of the second phase
Oo, is there a way I can release immediately after the new subscription has been change over?
Your system can listen to customer.subscription.updated event and check whether the items have been updated in a subscription. If so, the subscription schedule can be released manually: https://docs.stripe.com/api/subscription_schedules/release
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks , let me try this ๐
If I don't store the previous subscription item, there is no way I can tell that's new though ?
The problem is we allow immediate upgrade too so we need to clear the subscription schedule
So a customer can downgrade and upgrade at the same time
Well, almost at the same time**
If I don't store the previous subscription item, there is no way I can tell that's new though ?
You can check whether there is anyitemschange indata.previous_attributesof thecustomer.subscription.updatedevent: https://docs.stripe.com/api/events/object#event_object-data-previous_attributes
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.