npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-monnify

v1.0.1

Published

Vue 2 & 3 Component (Paybutton 💰) for Monnify

Downloads

22

Readme

Vue Component for Monnify

A Vue Plugin (Pay Button 💰) for Monnify payment gateway.
It wraps the official Monnify Web SDK;
Making it pretty straightforward to add Monnify Pay Button to your vue-based application.
Available for Vue 2 & 3

Installation

NPM

npm install vue-monnify --save 

Javascript via CDN

<!-- Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- Vue-Monnify -->
<script src="https://unpkg.com/vue-monnify/dist/vue-monnify.min.js"></script>

Usage

<template>
    <vue-monnify
        ref="vueMonnifyButton"
        :amount="amount"
        :api-key="monnifyAPIKey"
        :contract-code="monnifyContractCode"
        :customer-email="email"
        :is-test-mode="monnifyIsTest"
        :metadata="payMetadata"
        :on-close="monnifyClose"
        :on-complete="monnifyComplete"
        :reference="payRef"
    >
      <!-- This could be an html template -->
       Make Payment
    </vue-monnify>
</template>

<script type="text/javascript">
  import VueMonnify from 'vue-monnify';
  export default {
      components: {
          VueMonnify
      },
      
      data(){
          return{
            monnifyAPIKey: process.env.MONNIFYAPIKEY, // This has both test and product values
            monnifyContractCode: process.env.MONNIFYCONTRACTCODE, // This has both test and product values
            monnifyIsTest: process.env.MONNIFYISTEST, // This should be true in test/dev environment and false in production
            payMetadata: {}, // This can be populated with key/values as you wish
            email: "[email protected]", // Customer email
            amount: 10000 // of type:Number and in naira
          }
      },
      
      computed: {
        payRef(){
          let _ref = "";
          const alphanumeric = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

          for( let i=0; i < 10; i++ )
            _ref += alphanumeric.charAt(Math.floor(Math.random() * alphanumeric.length));

          return _ref;
        }
      },

      methods: {
        monnifyComplete: function(response){
          // Perform other operations upon complete
          console.log("Monnify Payment Complete", response)
        },
        monnifyClose: function(data){
          // Perform other operations upon close
          console.log("Monnify Payment closed", data)
        }
      }
  }
</script>

For Nuxt

In /plugin/components.js

import Vue from 'vue'
import VueMonnify from 'vue-monnify'

Vue.use('VueMonnify', VueMonnify)

// Other components package can be here too.

In nuxt.config.js

//...
plugins: [
  '@/plugins/components',
],
//...

In page or component as seen above (where its used)
You don't need to add

import VueMonnify from 'vue-monnify';

All Props Available

reference: String (required)
contractCode: String (required)
apiKey: String (required)
customerEmail: String (required)
customerName: String (required)
customerMobileNumber: String (required)
amount: Number (required)
isTestMode: Boolean (required) [true] // possible values: [false] or [true]
onComplete: Function (required)
onClose: Function (required)
metadata: Object (optional) [{}]
currency: String (optional) ['NGN']
paymentDescription: String (optional) ['']
paymentMethods: StringArray (optional) ['ACCOUNT_TRANSFER'] // possible values: ['CARD', 'ACCOUNT_TRANSFER']
btnClass: String []

i.e
// prop: DataType (required or optional) [default value]

Development and Testing

To simulate a bank transfer, Monnify provided a bank app simulator that works nicely. Click here

Contribution

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities

Appreciation

Give it a star and share the link to the repo on your social platforms.
Thanks! Adedoyin Akande,
Twitter: @aeadedoyin

License

The MIT License (MIT). Please see License File for more information.