#leuquim
1 messages · Page 1 of 1 (latest)
In our case we just require a 1 time payment, not recurring
You can ask the customer what plan they want and only then create an Invoice.
Ok, so then if they switch plans I'll just create more invoices, and they pay the last one they choose?
Yes
Or just create an Invoice when they confirm they want to pay.
In a separate step.
They currently confirm payment by clicking on the "Pay" button of the Stripe Elements UI, which requires the invoice to be finalized to get the client secret etc.
But are you mainly interested in Invoices or Prices/Products?
I guess I'll just need to create an invoice each time they change option
Prices/Products
Then you can use the new Embedded Checkout: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=embedded-checkout
Checking it out!
@snow steeple I don't see an option in the checkout documentation that allows specifying optional products (i.e. different service plans) - instead I need to specify the exact product the user is going to pay for. Is this correct? If so, I would need to regenerate a new checkout session & update the embed UI each time the user selects a new plan. Is this what you were proposing?
Page sections would be like:
[ Custom plan selection ] <-- Click on a plan
[ Embed Checkout ] <-- Re-render on change
Do you want plan selection and checkout form on the same page?
I see. What exactly do you need from the Products/Prices API? Use it as a database for your plans?
We like that we can manage product data & prices from Stripe, the ability to use Discount Codes & how Stripe can keep data about which products were sold in each invoice, vs now it's just a Payment Intent description and amount.
I can't see anything in the API docs that would allow us to do what I'm looking for so for now I think we'll have to settle with creating + finalizing a new invoice each time the user selects a different plan in the UI. Will create some "orphan" invoices but shouldn't be a big problem
Ok. You either can create new Invoices when the customer changes the plan. Or just use Prices as a database, and just take the amount to set on your raw PaymentIntents.
Got it. Thanks for your help!
You can still record the Price ID in PaymentIntent metadata