#ironbeard_best-practices
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/1450590612347682877
๐ 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.
- ironbeard_best-practices, 2 hours ago, 74 messages
- ironbeard_subscription-save-payment-methods, 1 day ago, 62 messages
- ironbeard_best-practices, 1 day ago, 41 messages
- ironbeard_code, 4 days ago, 18 messages
- ironbeard_code, 4 days ago, 31 messages
- ironbeard_integration-questions, 5 days ago, 36 messages
and 1 more
heyo toby ๐
Hello ๐
You'll want to create a new Subscription.
The first Invoice will already be finalized, and won't include the updates that you make.
Correct. With default_incomplete, the first Invoice is still finalized when the Subscription is created, but the Payment Intent isn't confirmed immediately.
what if a user is upgrading an existing subscription? I send an update call with the prices/items in their cart on the GET of the review page...and then if they change their mind and go back to edit their cart, in this case I assume updating the subscription again is the right move?
I wouldn't update the Subscription until you know for sure what changes need to be made. Since rolling back those updates is really tedious, and may mess up proration calculations.
yeah, for sure. ๐ค
Creating a Preview Invoice would probably work better there:
https://docs.stripe.com/api/invoices/create_preview
Or using Pending Updates maybe:
https://docs.stripe.com/billing/subscriptions/pending-updates
good point, i'm somewhat familiar with those. but if my "Review" page is going to have a link to change your cart, then it seems like I can't create/update the Subscription until after they click the "Submit order" button. I was going to have that button call JS stripe.confirmPayment() with the latest_invoice.payment_intent / .client_secret and a confirmation token.
I think it still can, just it may need to do some other lifting first depending on the exact flow you're settling on.
actually, pending-updates seems kind of right:
- if new subscription and user changes their cart, delete the subscription and create a new one
- if existing subscription, apply pending updates on the GET of
/checkout/review/. If they change their mind, the existing subscription hasn't fundamentally changed, so I can do a different pending update after they change their cart and GET/checkout/review/a second time.
Would I need to do anything to "clear" the initial pending update?
I don't believe so, and the guide seems to align with that
You can clear them though if that is easier
oh, nice. I need to spend more time with the guide, thank you!