vue-stripe-js icon indicating copy to clipboard operation
vue-stripe-js copied to clipboard

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

Open Dante690 opened this issue 2 years ago • 7 comments

Dante690 avatar Oct 12 '22 13:10 Dante690

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: https://github.com/ectoflow/vue-stripe-js/blob/92bb1c9de3834cf0604825de22f90f09071df9e9/examples/CardOnly.vue#L10

softbeehive avatar Oct 18 '22 20:10 softbeehive

Also we need a full payment element guide for this.. like card example...thnks

Dante690 avatar Oct 21 '22 08:10 Dante690

await elms.value.instance.confirmCardPayment(clientSecret, { payment_method: { card: cardNumber } })

tanha1998 avatar Nov 03 '22 10:11 tanha1998

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 avatar Nov 03 '22 10:11 softbeehive

@softbeehive If you wanna assign this to me I can probably submit a PR with an example for using Payment Elements this weekend.

yashBhosale avatar Apr 14 '23 07:04 yashBhosale

@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"

softbeehive avatar Apr 14 '23 08:04 softbeehive

does anyone have a working example with payment intent??

mattvb91 avatar Oct 18 '23 12:10 mattvb91