Can you provide a full example code with Payment Elements with create a payment intent first (client secret ..)
Dante690 opened this issue ยท 7 comments
Hi,
Alright, let's take a look. Do you mean the type "payment" element with payment intent, right?
As a start point you can add type='payment'
to:
vue-stripe-js/examples/CardOnly.vue
Line 10 in 92bb1c9
Also we need a full payment element guide for this.. like card example...thnks
await elms.value.instance.confirmCardPayment(clientSecret, { payment_method: { card: cardNumber } })
https://stripe.com/docs/payments/accept-a-payment?ui=elements
I'm gonna provide a full example, which requires stripe account and payment intent (server-side), but really tight on time right now
Basically, you need client_secret
, it then passed as property of options to StripeElements. Then you'll be able to call confirmPayment
on stripe instance.
@softbeehive If you wanna assign this to me I can probably submit a PR with an example for using Payment Elements this weekend.
@yashBhosale you are welcome to submit a PR at any time
Here is some guidance:
- Create PaymentType.vue in examples folder
- Use Vue Composition API (preferably)
- Test payment type element
- Add Payment Type section to README.md before "Types"
does anyone have a working example with payment intent??