Skip to content

ECJ222/vue-paystack2

Repository files navigation


Vue-Paystack2 is a Paystack payment gateway integration for Vue which
provides Universal support for Vue 2 & 3

Table of Contents

Install

Install this as your plugin's dependency:

npm i vue-paystack2
# or
yarn add vue-paystack2

If you are using Vue2 you would need to install Vue's Composition API:

npm i @vue/composition-api
# or
yarn add @vue/composition-api

Usage

<template>
    <VuePaystack :paystack-key="paystackKey" :firstname="firstname" :lastname="lastname" :email="email" :amount="amount"  :reference="reference" :callback="onSuccess" :close="onClose">
      Button
    </VuePaystack>
</template>

<script>
import VuePaystack from "vue-paystack2"

export default {
  name: 'App',
  components: {
    VuePaystack
  },
  data () {
    return {
      paystackKey: '...',
      email: '...',
      firstname: '...',
      lastname: '...',
      amount: 0,
      reference: '...'
    }
  },
  methods: {
    onSuccess (event) {
      // ...
    },
    onClose () {
      // ...
    }
  }
}
</script>

License

Inspired by vue-paystack

MIT License © 2021 Enoch Chejieh