ectoflow/vue-stripe-js

Can you provide a full example code with Payment Elements with create a payment intent first (client secret ..)

Dante690 opened this issue ยท 7 comments

Can you provide a full example code with Payment Elements with create a payment intent first (client secret ..)

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:

<StripeElement ref="card" :elements="elements" :options="cardOptions" />

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:

  1. Create PaymentType.vue in examples folder
  2. Use Vue Composition API (preferably)
  3. Test payment type element
  4. Add Payment Type section to README.md before "Types"

does anyone have a working example with payment intent??