Coder Social home page Coder Social logo

multi-payment-processor's Introduction

Multi-Payment-Processor

Multi-Payment-Processor is a [Javascript] package to work with all payment processors as one in an asynchronous environment. Multi-Payment-Processor gives the ability to switch between processors without worrying about breaking codes

Installation

npm i multi-payment-processor

Usage

Open your .env file and add your public key, secret key and selected processor like so:

PROCESSOR=PAYSTACK|FLUTTERWAVE|MONNIFY
PAYSTACK_SECRET_KEY=xxxxxxxxxxxxx
FLUTTERWAVE_SECRET_KEY=xxxxxxxxxxxxx
MONNIFY_SECRET_KEY=xxxxxxxxxxxxx
MONNIFY_API_KEY=xxxxxxxxxxxxx

If you are using a hosting service like heroku or render ensure to add the above details to your configuration variables.

const mpp = require('multi-payment-processor');

To Get All Banks

const mpp = await mpp().getAllBanks();

To Verify Bank Account

const accountObject = {
accountNumber:request.body.accountNumber,
bankCode:request.body.bankCode
}

const bankAccount = await mpp.verifyBankAccount(accountObject);

To Initiate Checkout

const paymentObject = {
emailAddress: request.body.emailAddress,
amount: request.body.amount,
callbackUrl: request.body.callbackUrl
}

const payment = await mpp.initiateCheckout(paymentObject);

To Verify Payment

const verifiedPayment = await mpp.verifyTransaction({paymentReference:request.body.paymentReference});

Available integrations

  • Get BankList
  • Verify Bank Account
  • Initiate Checkout
  • Verify Payment

multi-payment-processor's People

Contributors

naijatechbro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.