#ianaylon - create pm
1 messages · Page 1 of 1 (latest)
You could use this stripe.js function: https://stripe.com/docs/js/payment_methods/create_payment_method
Hmmmm. This can be used with payment elements?
Yeah
Got it. I just miss one step.
Create element -> mount element -> user enters cc details -> and then... How do I create the payment method without charging? I want the user to press "Submit", send the payment details to Stripe and get the token back
You can pass in the element here: https://stripe.com/docs/js/payment_methods/create_payment_method#stripe_create_payment_method-paymentMethodData-card. And our docs mention you pass a card element or cardnumber element. You can try with a payment element (I think it would work, but not 100% sure actually). You may have to use card element or card number element.
Okay, we'll try. Thanks!
So for Payment Element you have to pass a client secret. You could just create a payment method by creating a setupintent without a customer, then passing the setupintent client secret to the payment element
And then call https://stripe.com/docs/js/setup_intents/confirm_setup
That would be the way to do it with the payment element
If you use the card element, you can use the original link i sent
@hushed pendant just so you see the above