#ibgoldbergs
1 messages · Page 1 of 1 (latest)
Out of interest, why create a Setup Intent separately if you're immediately creating a Subscription? This isn't very optimal
Looking at your actual Q now
What is the best way to retrieve how much the client will be billed for or credited? We would like to display this in our UI and I can't quite figure out the most elegant way to retrieve this type of data.
You'd use this endpoint: https://stripe.com/docs/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
We are creating setup intent in order to make sure the credit card is OK and that we can provide an error to the user on the front end if its not okay
Is there a more optimal way?
How do we use invoices/upcoming if we want to show the user how much they will be billed for / credited PRIOR to processing the upgrade?
Well the Subscription will handle that for you (e.g. creating a Setup Intent in instances where there's no immediate payment, or a Payment Intent when there is)
You'd use the subscription_items and subscription param to reflect the upgrade/downgrade you want to preview
Not sure I understand. What is the order of operations? Here's what my current thinking is:
- User chooses plan / price point in the UI
- User chooses which payment method they want to use for the upgrade / downgrade
- User should be able to preview how much the upgrade will cost or how much the downgrade will credit them (using always invoice prorations)
- User can then complete transaction and we hit the subscription update endpoint, removing the old price point and adding the new one.
What I'm not sure how to do is #3 in this flow.