@irembo/irembopay-node-sdk

1.0.0 • Public • Published

Irembo Pay Node SDK

IremboPay offers a robust Node.js SDK designed to simplify the integration of payment functionalities into your applications. The SDK provides developers with a comprehensive set of tools to manage transactions, making it easier to handle payment processing within the IremboPay ecosystem.

Installation

Install irembopay-node-sdk with npm

  npm install @irembo/irembopay-node-sdk

Initialization

const IremboPay = require("@irembo/irembopay-node-sdk").default;
const iPay = new IremboPay(process.env.IPAY_SECRET_KEY,process.env.IPAY_ENVIRONMENT)

We currently have 3 environment sandbox, checkout and production

Usage/Examples

create invoice

iPay.invoice.createInvoice({
      transactionId: "TST-100236",
      paymentAccountIdentifier: "07808652516",
      customer: {
        email: "user@email.com",
        phoneNumber: "0780000001",
        name: "Jixle Manzi",
      },
      paymentItems: [
        {
          unitAmount: 2000,
          quantity: 1,
          code: "PC-aaf751b73f",
        },
      ],
      description: "Invoice description",
      expiryAt: "2024-09-30T01:00:00+02:00",
      language: "EN",
    }).then((data) => {
        console.log(data);
    }).catch((error) => {
        console.log(error);
    });

Create Invoice in Batch

    iPay.invoice.createBatchInvoice({
        invoiceNumbers: ["880530635201", "880530633460"],
        transactionId: "TST-1001125",
        description: "Batch description",
      }).then((data) => {
        console.log(data);
      }).catch((error) => {
        console.log(error);
      });

Get invoice

iPay.invoice.getInvoice(880530633460).then((data) => {
        console.log(data);
      }).catch((error) => {
        console.log(error);
      });

Update invoice

iPay.invoice.updateInvoice(880530633460, {
  "expiryAt": "2024-08-24T14:15:22Z",
  "paymentItems": [
    {
      "unitAmount": 2000,
      "quantity": 1,
      "code": "PC-aaf751b73f"
    }
  ]
}).then((data)=>{
    console.log(data);
}).catch((error)=>{
    console.log(error);
});

Initiate mobile money push payment

iPay.payment.mobileMoney.initiatePayment({
  "accountIdentifier": "0781110011",
  "paymentProvider": "MTN",
  "invoiceNumber": "880310977877",
  "transactionReference": "MTN_001"
}).then((data)=>{
    console.log(data)
}).catch((error)=>{
    console.log(error)
})

Bugs

No known bugs. If you find any, please reach out or raise an issue and we will check it out.

Point of Contact

In case of inquiries or assistance, please refer to our designated point of contact for this project.

Readme

Keywords

none

Package Sidebar

Install

npm i @irembo/irembopay-node-sdk

Weekly Downloads

11

Version

1.0.0

License

MIT

Unpacked Size

16 kB

Total Files

16

Last publish

Collaborators

  • ishimwe-samuel
  • irembopay