This SDK allows you to integrate with the MoneyXPay payment gateway easily.
To install the package, run:
npm install moneyxpay-sdk
Below is a sample implementation:
import PaymentGatewaySDK from 'moneyxpay-sdk';
const paymentService = new PaymentGatewaySDK('your-client-id', 'your-client-secret', 'your-integration-key');
const adviceRequest = {
amount: 1000,
currency: 'NGN',
merchantReference: 'merchant-ref',
narration: 'Test Payment',
callBackUrl: 'https://callback.url',
customerId: 'cust-001',
customerLastName: 'John',
customerFirstName: 'Doe',
customerEmail: 'john.doe@example.com',
customerPhoneNumber: '08065456765',
customerCountryCode: 'NG'
};
paymentService.payments.createAdvice(adviceRequest)
.then(response => console.log(response))
.catch(error => console.error('Error:', error));
sample response:
{
"requestSuccessful": true,
"responseData": {
"currency": "NGN",
"adviceReference": "eccba145-0ffc-48b5-b53c-cecbb97cfgf",
"merchantRef": "ref00df1tyu",
"amount": 1000,
"narration": "Test Payment",
"customerId": "cust-001",
"charge": 0,
"status": "Pending",
"customerFullName": "Doe John",
"merchantName": "Business",
"merchantCode": "tes000123",
"merchantId": "3915034567",
"paymentUrl": "https://www.payment.codebytesltd.com/?adviceReference=eccba145-0ffc-48b5-b53c-cecbb97cfgf",
"channels": [
"Card",
"BankTransfer",
"BankAccount",
"USSD",
"QRCode",
"MoneyXPayWallet"
],
"channel": [
"Card",
"BankTransfer",
"BankAccount",
"USSD",
"QRCode",
"MoneyXPayWallet"
],
"customerCharge": 0,
"merchantCharge": 0,
"vatCharge": 0
},
"message": "Successful",
"responseCode": "00"
}
For more details, refer to the [official documentation](https://docs-payment-api.codebytesltd.com).