#MidnightCrow
1 messages · Page 1 of 1 (latest)
Hello 👋
Not sure I fully understand, are you only trying to create a PaymentMethod using PaymentElement without using SetupIntents?
With card element, you are able to generate a token and let your backend handle creating a payment source with that token.
With payment element, it seems like you have to handle the saving of a payment only on the front end with setupIntent and then confirmPayment. Is there no way to handle the confirmPayment on the server side?
Ah I see. We recently launched deferred intent approach which let's you create payment methods with PaymentElement without creating an intent
https://stripe.com/docs/payments/accept-a-payment-deferred?type=setup
That's likely what you want
it looks like confirmSetup still takes the elements object you use in the front end, so this step has to be done on the client side?
Yeah that's correct. I don't think there's a way to completely do that server-side unfortunately..
Just to clarify: with the card element you can correct? You generate a card token with the elements and then you can send that token securely to the server side?
Yes, you can use createPaymentMethod function with card element
https://stripe.com/docs/js/payment_methods/create_payment_method
OR use createToken function
https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement