rexpay
v1.0.5
Published
RexPay payment page access
Downloads
13
Readme
RexPay NPM Library
A Node.js library for integrating with the RexPay payment gateway.
Installation
npm install rexpay
import RexPay from "rexpay";
// Initialize RexPay
const rexPay = new RexPay();
// Example: Initialize Payment
const paymentData = {
"reference": "12345678",
"amount": 100,
"currency": "NGN",
"mode": "Debug",
"userId": "[email protected]",
"callbackUrl": "google.com",
"metadata": {
"email": "[email protected]",
"customerName": "Test User"
}
};
rexPay.initializePayment(paymentData)
.then(response => {
// handle success
})
.catch(error => {
// handle error
});
// Example: Verify Payment
const verificationData = {
"transactionReference": "12345678"
};
rexPay.verifyPayment(verificationData)
.then(response => {
// handle success
})
.catch(error => {
// handle error
});
Request for calling InitialisePayment function.
To initialize the transaction, you'll need to pass information such as email, first name, last name amount, publicKey, etc. Email and amount are required. You can also pass any other additional information in the metadata object field. Here is the full list of parameters you can pass:
|Param | Type | Default | Required | Description
| :------------ | :------------------- | :--------- | :------- | :-------------------------------------------------
| amount | number
| undefined | true
| Amount you want to debit customer e.g 1000.00, 10.00...
| reference | string
| undefined | true
| Unique case sensitive transaction identification
| userId | string
| undefined | true
| Email address of customer or any user identification
| mode | Debug or Live
| undefined | Debug
| your mode of environment. The value can either be Live or Debug.
| currency | string
| NGN
| true
| Currency charge should be performed in. Allowed only NGN
.
| mode | string
| Debug
| true
| Allowed values are Debug
or Live
.
| callBackUrl | string
| your current url page | false
| CallbackUrl is the url you want your customer to be redirected to when payment is successful. The default url is the page url where customer intialized payment.
| metadata | object
| empty object
| false
| Object containing any extra information you want recorded with the transaction.