#JeremyFlight
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Thanks
stripe.confirmPayment(): https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
Ah, OK. That's exactly what I was trying!
Let me just check what error I was getting...
I get this error:
IntegrationError: Your code called confirmPayment() but you passed a client_secret associated with a SetupIntent. Did you mean to call confirmSetup() instead?
Yes, then you need to use confirmSetup() if you use SetupIntents
Does that take the same parameters?
With my return_url, what do I need to get it to output in order for Stripe to be happy that everything's worked OK?
return_url is the location on your site that you want the customers to land onto after they've completed the purchase.
Yes, that's fine - but do I need to make that page do anything with Stripe to complete the process?
No, that's not required.
ok, so if my customer hits my “thank you” url, I know that their setup intent completed successfully with the payment details they entered?
It's best to do any post-purchase business logic using webhooks: https://stripe.com/docs/webhooks
That’s fine They’re not buying anything at this stage: it’s just checking that they have valid payment details.
Am I able to make Stripe elements show a field for cardholder’s name as well as fields for card number, CVV etc. When using a payment element?
You can use the Address Element: https://stripe.com/docs/elements/address-element/collect-addresses?platform=web
So I mount an address element and a payment element within the same HTML form?
Yes, then you can adjust what data you want to collect, and whether it's for shipping or for billing.
OK, thank you
Happy to help!