Skip to content

notchpay/notchpay-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Notch Pay Javascript Library

NPM Version NPM Downloads NPM License

Introduction

La bibliothèque Javascript simplifie l'utilisation des API de Notch Pay dans vos applications Javascript. Elle masque la complexité de l'intégration directe, facilitant ainsi des appels rapides et efficaces aux API.

Available functionalities include:

  • Payment : Paypal, Mobile Money,

Table of Content

  1. Requirements
  2. Installation
  3. Initialization
  4. Usage
  5. Support
  6. License
  7. Changelog

1. Requirements

  1. Node 12 or higher.
  2. Notch Pay API Keys

2. Installation

To install the package, run the following command in your Node terminal:

npm install notchpay.js

3. Initialization

import NotchPay from 'notchpay.js';

const notchpay = NotchPay(
    "YOUR_PUBLIC_KEY", 
    { debug : true, } 
);

For staging (Test environment), use the Sandbox Public Keys and for production, use LIVE Public KEYS. You can obtain your PUBLIC_KEY and PRIVATE_KEY keys from the Notch Pay dashboard: https://business.notchpay.co/developer/api-keys.

4. Usage

  1. Collections : Paypal, Mobile Money

This section describes how you can collect payments in the SDK. Find out more about the payment method.

const paymentInitiated = await notchpay.payments.initializePayment({
      currency: "XAF", 
      amount: "5000", 
      email: "WWWWW", 
      phone: "XXXXX", 
      reference: "ref." + (Math.floor(Math.random() * (2000 - 100 + 1)) + 100), 
      description: "Payment for testing the Notch Pay SDK"
});


// console.log("Payment Initialized Informations: ", paymentInitiated);
const paymentDetails = await notchpay.payments.verifyAndFetchPayment(paymentInitiated.transaction.reference);
const paymentCompleted = await notchpay.payments.completePayment(
    paymentInitiated.transaction.reference, 
    { 
        channel: 'string', 
        data: { 
            phone: 'MTN Mobile or Orange mobile money number to be charged'
        }
    }
);
  • List Payments : This endpoint allows you to retrieve a paginated list of all your payments.
const paymentList = await notchpay.payments.listPayments({perpage: 10, page: 2});
const paymentCancelled = await notchpay.payments.cancelPayment(response.transaction.reference);

// console.log(paymentCancelled);

5. Support

Pour toute aide supplémentaire concernant l'utilisation de cette bibliothèque, contactez l'équipe technique via email ou sur Telegram. Vous pouvez également nous suivre sur Twitter et nous faire part de vos commentaires.

6. Debugging Errors

We understand that you may encounter errors when integrating our library. You can read more about our error messages here. For error responses authorization 401 and validation 422, please check your API keys and your request. If you get a server error, please contact the team for support.

7. License

By contributing to this library, you agree that your contributions may be placed under the MIT license. Copyright (c) Notch Pay Sarl.

8. Change Logs

About

Notch Pay Javascript Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published