#erick_api

1 messages ¡ Page 1 of 1 (latest)

tardy cliffBOT
#

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

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

sterile ingot
wind horizon
#

This will charge the card on file immediately for the difference in the amount?

#

I was expecting to send the customer to the stripe page to confirm their payment, similar to what we do when they purchase a membership extension. Is there a way to use this process? Otherwise, we'd need to estimate this amount and display it on the screen, kind of creating our own checkout page. I'm concerned it wouldn't contain the exact amount.

sterile ingot
wind horizon
#

It sounds like that doesn't actually generate a stripe-branded page where the customer can go to approve the invoice. I assume that's not possible. (let me know if it is, as this would be preferred) So it seems like the pathway I need to follow is this:

  1. Create a preview invoice with the subscription_details defining the change to the subscription, which in our case would be to replace the price ID with the new price ID and resetting the cycle to start a new subscription period.

  2. Display the response to the user along with the amount that would be charged, and let them approve it. Take note of the create date of the preview so it can be used in the actual request.

  3. When the customer approves it, call into the API in order to actually execute the change to their subscription. Pass the create date of the preview invoice as the proration_date in this request to ensure the amounts stay the same.

It also seems that we would need to give them separate access on this call to change the credit card on file. Probably we'd want to show them the type and last four digits of what's on file so they'd know what will be changed. Then we can give them the link to update their payment method if they want to change it.

Does this all make sense?

sterile ingot
#

Yep, that makes sense. And I can confirm this isn't something we provide out of the box, it's something you'd need to build on your end.

wind horizon
#

Thank you. This was a big help. I can't imagine how many rabbit holes I'd have to go down to figure out this path. I didn't even know a preview invoice was a thing. I really appreciate it. I think you've saved me a lot of time!