#junior_dev
1 messages · Page 1 of 1 (latest)
👋 SetupIntents can't be used to charge the PaymentMethod a specific amount
You'd likely need a payment intent for that.
Can you provide more information about your usecase?
Saving the PaymentMethod details during payment might be a better flow for your usecase
https://stripe.com/docs/payments/save-during-payment?platform=web
Regarding the PaymentIntent, it seems we have to use the Element component to retrieve the payment method. Is it possible to have a "Hosted" version like during the SetupIntent ?
Not sure I completely follow, are you looking at a specific step in the guide?
Are you referring to Stripe Checkout vs Custom flow?
That's my use case
I want to bill a new (or existing customer) for a specified amount. And I want to save (if not already saved) the payment-method for futur usages.
I would like to retrieve a link (like for the setupIntent but with an amount) that redirect my user to the Hosted Checkout page
And thanks for your time
👋
So you will need to know ahead of time whether the Customer is new or existing as these would be two different flows.
For new Customers you want to create a Checkout Session and pass payment_intent_data.setup_future_usage: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
That would save the PaymentMethod for a future payment.
If it is an existing customer then you just create/confirm a new PaymentIntent in your backend like we show here: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
Yeah that's what I though, but I still have 2 issues with these flow.
For the Checkout Session, I want to customize the page and only shows the Payment_method forms without the line_items on the sides. Can we customize it or is it not possible ? (I saw that you can add custom fields but not about removing them)
For the PaymentMethod, I don't want to use the custom Web Component to retrieve the Payment-Method, I would rather use the hosted checkout you guys made already 🙂
Anyways, thanks for your time and reactivity, really appreciate that
You can't remove line_items in a Checkout Session, no.
With Checkout you can send them through a Checkout Session again and pass the Customer ID. As long as the PaymentMethod was properly set up before then it will pre-fill that info
See: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer which explains this
Regargind the Checkout session with a Customer ID specified. Does the customer can then Edit the prefilled card details ?
What I mean is, If the customer already exists, with let's say CARD N°1, then the CARD N°1 details will be prefilled, but does the customer can then replace it with CARD N°2 infos ?
Pretty positive yes. Don't actually remember 100% off the top of my head but should be pretty easy to just run a quick test to find out.
I see, thanks for the feedback and the help 🙂