-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I use this library with Payment Elements? #11
Comments
Hi, yes you can use Payment Element
<StripeElements
...
>
<StripeElement
type="payment"
...
/>
</StripeElements>
I'll keep this issue open until full payment element guide is ready. |
And how can we pass payment intent client secret? EDIT: Nevermind, got it. :) |
@Aniruddh-J How did you submit the payment element? |
I'd also be interested in how you got the payment element submitting - got it all loading on my end, but when submitting as running into errors trying to get it working. I either get:
When I use the following code:
Or
When I use this code:
Unsure of what else to try. |
Sorry for the delay in the response. You need to supply clientSecret in elements options.
EDIT: You need to create a payment intent first: https://stripe.com/docs/api/payment_intents/create The API response will give you a client secret. Use it in the code above, and the code should work. |
I got the payment intent and client secret, but I get the same errors when doing a confirmPayment request. Did you get it working? |
@TommyLeadJabber Could you please paste the code you are using to achieve this? |
Which part? The confirmPayment request are more or less identical to the examples in the code I quoted. I get one of the error messages from the quoted code, depending on what I try to pass in. |
Did you supply the client secret the way I mentioned in my previous post?
I am sorry I am asking this because I don't see your exact setup, and sometimes very small things we miss can be the reason. *** removed the edit, I got confused, sorry. **** |
Yes, I managed to create a payment intent and used the clientSecret from that to set up the payment element (if I didn't, the element wouldn't load and I would get an error telling me to create a payment intent). When I type in the credit card info , and try to send the data with confirmPayment, that's when I get those errors. |
I noticed one minor issue in the example code above. The mandatory
Please try it and let me know if it solves your issue. EDIT: I have made one more edit. |
Nice, that last edit of yours did the trick! Thanks for your help, really appreciate it 👍 |
Hi,
How can I use this library to use Payment Element instead of Card Element? Any sample code would be highly appreciated.
@softbeehive
Thank you
Bill
The text was updated successfully, but these errors were encountered: