#zzawaideh-payment-element

1 messages ยท Page 1 of 1 (latest)

vast garden
#

๐Ÿ‘‹ Happy to help

brazen fog
#

Hi @vast garden I would appreciate it very much, I have been fretting this for hours

#

Is there any other information that I could provide that would help?

vast garden
#

createPaymentMethod is not supported using Payment Element

brazen fog
#

So my understanding is that these guides that you sent talk about PaymentElement as something used to save card details for later. Is there not a way to utilize it as a pay now feature?

vast garden
#

Ah, I'm assuming that you want to collect payment method only

brazen fog
#

But payment element should work for both of these?

vast garden
#

Can you explain what you want to achieve?

brazen fog
#

I am trying to create a "pay now" type form using the PaymentElement component. (I do not want to redirect to a Stripe payment page)

#

.createPaymentMethod created and registered a payment with the CardElement and my thinking was that I could plug the same function into the PaymentElement as they contain the same information (number, exp, and cvc)

vast garden
#

Ah no! createPaymentMethod then charge to the payment method is the legacy way. In Payment Element, you will need to create a payment intent first, and pass its client secret to frontend to render Payment Element. Then confirm payment upon user clicking the submit button

brazen fog
#

Thank you very much my friend, I will look into this document. I think you sent what I was looking for and I did not realize I was practicing legacy code. Again, thank you!

vast garden
#

No problem! Happy to help ๐Ÿ™‚