vue-payant
v1.0.0
Published
Vue Payant Component for Vue 2.x.
Downloads
2
Maintainers
Readme
Vue-Payant
A Vue package for Payant payment gateway.
Installation
npm install vue vue-payant --save
# OR
yarn add vue-payant
Example
<template>
<payant
:first_name="first_name"
:last_name="last_name"
:email="email"
:payantkey="payantkey"
:reference="reference"
:callback="callback"
:close="close"
:embed="false"
>
Make Payment
</payant>
</template>
<script type="text/javascript">
import payant from "vue-payant";
export default {
components: {
payant,
},
data() {
return {
payantkey: "pk_test_xxxxxxxxxxxxxxxxxxxxxxx",
first_name: "Adavize",
laset_name: "Ozorku",
email: "[email protected]", // Customer email
};
},
computed: {
reference() {
let text = "";
let possible =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 10; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
},
},
methods: {
callback: function(response) {
console.log(response);
},
close: function() {
console.log("Payment closed");
},
},
};
</script>
Please checkout Payant Documentation for other available options you can add to the tag
How to contribute ✨
- Fork it!
- Create your feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -am 'Some commit message'
- Push to the branch:
git push origin feature-name
- Submit a pull request 😉😉
License
This project is licensed under the MIT License - see the LICENSE.md file for details