#abdu77ah_api

1 messages ¡ Page 1 of 1 (latest)

twilit hingeBOT
#

👋 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/1309156917905719406

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sick herald
#

hi there!

#

having a look

#

can you share the code you used to try to end the trial?

ornate cloak
#

i called the API with Shell

#

in stripe workbench

sick herald
#

can you share the command you used?

ornate cloak
#

i think it's a API Explorer problem

ornate cloak
#

It's called API Explorer I think

sick herald
#

the line of code at the very bottom is just updating the subscription without setting any parameter. let me try to reproduce in workbench...

ornate cloak
#

seems like it is not working when you type now

sick herald
#

yep I managed to reproduce. it works with timestamp, but not "now".

#

I'll report that to the team, thanks for flagging!

#

in the meantime, you should be able to use the Stripe API, Stripe CLI, or the Stripe Dashboard itself to udpate the Subscription.

ornate cloak
#

yeah thanks

#

I have another question but it is a different issue

sick herald
#

sure, you can ask it here

ornate cloak
#

There's a feature I need to implement. When customer a has signed up in our app on trial (without payment method) he/she can end a trial early by adding payment method, pay the subscription fee and then move to Active from Trailing. But I couldn't find a straight forward way to do this with Stripe. Can you help me design this flow from both client-side and server-side perspective?. Currently I am thinking of this workaround. User clicks a button and our backend (BE) will create a billing portal url where he/she can add payment detail. Then BE will wait for some event from Stripe (I couldn't find an event of "Payment details added") in order to call subscription update API with "trail_end"="now". Then stripe will automatically charge user's payment creds.

#

I also tried creating a Checkout Session but when customer pays. A new subscription is created instead of moving existing subscription to "active" which is not good I guess.

sick herald
#

(I couldn't find an event of "Payment details added")
I recommend testing this in test mode to see the events triggered. but you should receive a payment_method.attached event

#

yes what you shared is an option.

I also tried creating a Checkout Session but when customer pays. A new subscription is created instead of moving existing subscription to "active" which is not good I guess.
that can't work, Checkout Session can only create a new Subscription, not edit an existing one. However you could use Checkout Session in setup mode instead of the Customer Portal to collect the Payment Method if needed.

ornate cloak
#

What's the difference between using Checkout Session in setup mode and Billing portal way as both are collecting users' payment detail?

sick herald
#

it's a different UI, but the end result is the same.

twilit hingeBOT