Documentation Index
Fetch the complete documentation index at: https://docs.fedapay.com/llms.txt
Use this file to discover all available pages before exploring further.
The FedaPay Node.js library simplifies payment management for server-side JavaScript applications, making it ideal for REST APIs and Node.js projects.
Installation
Use npm to install the library :
npm install fedapay --save
Use Case
example of creating a customer
const { FedaPay, Customer } = require('fedapay');
/* Replace YOUR_SECRETE_API_KEY with your real API key */
FedaPay.setApiKey("YOUR_SECRETE_API_KEY");
/* Specify whether you want to run your query in test or live mode */
FedaPay.setEnvironment('sandbox'); //or setEnvironment('live');
/* Create customer */
const customer = await Customer.create({
firstname: 'John',
lastname: 'Doe',
email: 'john@doe.com',
phone_number: {
number: '90090909',
country: 'BJ'
}
});
example of creating a transaction
const { FedaPay, Transaction } = require('fedapay');
FedaPay.setApiKey('YOUR_SECRET_API_KEY');
FedaPay.setEnvironment('sandbox');
const transaction = await Transaction.create({
description: 'Payment for order #1234',
amount: 1000,
currency: { iso: 'XOF' },
callback_url: 'https://example.com/callback',
mode: 'mtn_open',
customer: { id: 1 }
});
To go further with Node.js integration, explore the following resources:Official GitHub repository : fedapay-nodeAPI Reference : api-referenceDemo app source code : node-sampleLive Demo : nodesampleThese resources provide a solid foundation for integrating FedaPay into your Node.js projects, with ready-to-use code examples.