Shut up and clone my repo!
A Vue plugin for Stripe checkout. I sh*t you not, this plugin is the easiest to use.
Demo
If you liked this repo then leave a ⭐, if not, I don't care. (Seriously leave a ⭐ please)
NPM or Yarn
npm install vue-stripe-checkout --save
yarn add vue-stripe-checkout
CDN
https://unpkg.com/vue-stripe-checkout/build/vue-stripe-checkout.js
Usage
import Vue from 'vue';
import VueStripeCheckout from 'vue-stripe-checkout';
// base/global options
// these options can be overridden
// by the options in the .open(options)
// function.
const options = {
key: 'your-publishable-key',
image: 'https://cdn.meme.am/images/100x100/15882140.jpg',
locale: 'auto',
currency: 'PHP',
billingAddress: true,
panelLabel: 'Subscribe {{amount}}'
}
Vue.use(VueStripeCheckout, options);
Just see the stripe docu for all of the available options.
Sample
Checkout will be available in the vm
or this
if you are using single file template (.vue
files).
<template>
<div>
<button @click="checkout">Checkout</button>
</div>
</template>
<script>
export default {
methods: {
checkout() {
// this.$checkout.close()
// is also available.
this.$checkout.open({
name: 'Shut up and take my money!',
currency: 'USD',
amount: 99999,
token: (token) => {
// Send the token to your server
// for payment or subscription handling,
// or do whatever you want with it
// I don't really care.
}
});
}
}
}
</script>
SPECIAL THANKS TO THE FOLLOWING SPONSOR(S):
Made with ❤️ by Jofferson Ramirez Tiquez