Package Exports
- notchpay.js
- notchpay.js/dist/notchpay-sdk.min.js
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 (notchpay.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Notch Pay Javascript Library
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
- Node 12 or higher.
- 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
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});
- Cancel Payment : Cancel a payment.
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.
(c) copyright - Notch Pay Sarl