#zzawaideh-payment-element
1 messages ยท Page 1 of 1 (latest)
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?
createPaymentMethod is not supported using Payment Element
With Payment Element, setup intent should be instead: https://stripe.com/docs/payments/save-and-reuse
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?
Ah, I'm assuming that you want to collect payment method only
This should be the right one: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
But payment element should work for both of these?
Can you explain what you want to achieve?
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)
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
You can refer to the link I shared: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements&html-or-react=react
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!
No problem! Happy to help ๐