JSPM

vue-payant

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q34357F
  • License MIT

Vue Payant Component for Vue 2.x.

Package Exports

  • vue-payant

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-payant) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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: "adavizeozorku@gmail.com", // 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 ✨

  1. Fork it!
  2. Create your feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Some commit message'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request 😉😉

follow me on twitter!

License

This project is licensed under the MIT License - see the LICENSE.md file for details