#jamestha3d_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/1339642721249529896
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Sorry I'm a bit confused by "pay for their trial subscripton after it's ended".
The request you shared is missing a necessary parameter. That is why it is failing.
HI. let me explain better. so i have created a free 30 day trial subscription for a user. the usre has to add a payment method to their account so that after 30 days they get charged for the next subscription interval. tnow if its past 30 days and the user did not add a payment method yet the subscription is paused. because i set it to 'pause'. now what i want is when they add their card and click start subscription it resumes. this already works with this configuration:
customer=customer['id'],
return_url=url,
however the user does not get redirected to the return url. they have to click on the button 'return to Company_name'.
what i want is for them to do this, and be automatically redirected to the return url.
I know this is possible because with this configuration:
customer=customer['id'],
return_url=url,
flow_data={"type": "payment_method_update", "after_completion": {"type": "redirect", "redirect": {"return_url": url}}})
This allows the user to update their payment method, and then redirects them automatically to my return url just as i want but it does not renew the subscription.
i hope this clarifies
Right. See, with the first portal session, you are only telling us where we should send the user back to when they click the "Back" arrow.
In the second session, you describe the flow you want the user to take.
But, because you specify that you only want the customer to update their payment method, Stripe doesn't do anything after that.
how do i specify that i want it to update the subscription as well?
i have tried swapping out "payment_method_update" for "subscription_update" but that requires me to pass in several params. and a config object
I don't think that is a flow we specifically have. Subscription update is if you want the customer to be able to change prices
I think you would need to trigger the unpause by paying the outstanding invoice
and how do i do that?
You can call the Invoice Pay API for that customer's outstanding invoice - https://docs.stripe.com/api/invoices/pay
i am surprisd because this works if i do not specify any flow_data. the subscription is resumed. but once i add flow_data it is no longer resumed.
As I said, the flow data locks the Customer in to a specific flow and does not take additional actions oustide of that flow
Perhaps it might be easier to isntruct your customers to click the Back button to be redirected before you send them to the billing portal?
yes i understand this now. but when i do not add flow_data, the customer goes to the portal they can add their payment method and start the subscription.
Right, I think that is easier for both you and the Customer.
The only part that doesn't work like you want is the redirect. The customer has to click the Back arrow
I think it might be easier for both you and the Customer if you just told them before you send them to the billing portal that, to get back, they should click the back arrow.
I can also submit a feature request to allow you to specify a Subscription restart in the flow_data for payment method updates.