Vue Stripe Elements
A Vue 2 component collection for stripe elements.
Usage example
Install package:
$ npm i vue-stripe-elements-plus --save
Add Stripe.js library to index.html:
<script src="https://js.stripe.com/v3/"></script>
Build a Vue component using the Card element:
Please give us your payment details: Pay with credit card
Multiple elements
Even if it is recommended to use the unified Card element, single elements for each field are supported. The following example shows a possible use in a credit card component:
Supported Stripe Elements Functions
Function | Reference |
---|---|
createToken() | https://stripe.com/docs/stripe-js/reference#stripe-create-token |
createSource() | https://stripe.com/docs/stripe-js/reference#stripe-create-source |
retrieveSource() | https://stripe.com/docs/stripe-js/reference#stripe-retrieve-source |
paymentRequest() | https://stripe.com/docs/stripe-js/reference#stripe-payment-request |
redirectToCheckout() | https://stripe.com/docs/stripe-js/reference#stripe-redirect-to-checkout |
retrievePaymentIntent() | https://stripe.com/docs/stripe-js/reference#stripe-retrieve-payment-intent |
handleCardPayment() | https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment |
handleCardSetup() | https://stripe.com/docs/stripe-js/reference#stripe-handle-card-setup |
handleCardAction() | https://stripe.com/docs/stripe-js/reference#stripe-handle-card-action |
confirmPaymentIntent() | https://stripe.com/docs/stripe-js/reference#stripe-confirm-payment-intent |
createPaymentMethod() | https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method |