Node.js

ZenoPay API Integration for Node.js

This project demonstrates how to send a POST request to the ZenoPay API using Node.js with the Axios library. It sends an order creation request to the API and logs the response or any errors encountered.

Requirements

  • Node.js (v14 or higher)

  • npm (Node Package Manager)

Installation

  1. Clone the Repository

git clone <repository-url>
cd <repository-folder>
  1. Install Dependencies

npm install axios qs

Configuration

Update the data object in the index.js file with your ZenoPay API credentials and order details:

Parameter
Use

buyer_name

The name of the buyer.

buyer_phone

The phone number of the buyer.

buyer_email

The email address of the buyer.

amount

The amount to be charged.

account_id

Your ZenoPay account ID.

secret_key

Your ZenoPay API secret key (if required).

api_key

Your ZenoPay API key.

Usage

Create the index.js File

Save the following code to index.js:

Error Handling

Errors during the API request are logged to the console. Check the error.response object for detailed information if available.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Last updated