Node.js Package
ZenoPay is a simple and seamless payment designed for developers looking to integrate secure and reliable payment functionality into their applications. With minimal setup, you can initiate payments .
Supported Mobile Networks
ZenoPay supports the following mobile payment networks:
M-PESA
TIGOPESA (MIX BY YAS)
HALOPESA
AIRTEL MONEY
Installation
Install the package using npm or yarn:
Usage
1. Backend Integration
Here’s how to integrate ZenoPay in a Node.js backend application:
API Reference
1. Pay(paymentOptions: PaymentOptionsType): Promise<RequestResponseType>
Pay(paymentOptions: PaymentOptionsType): Promise<RequestResponseType>
Initiates a payment request.
Parameters:
paymentOptions
: An object with the following properties:amountToCharge
(number): Amount to charge (must be greater than 0).customerName
(string): Full name of the customer.customerEmail
(string): Email address of the customer.customerPhoneNumber
(string): Phone number of the customer (10 or 12 digits).
Response:
Returns a promise resolving to:
2. CheckPaymentStatus(orderID: string): Promise<RequestResponseType>
CheckPaymentStatus(orderID: string): Promise<RequestResponseType>
Checks the status of a payment.
Parameters:
orderID
(string): Unique identifier of the order to track.
Response:
Returns a promise resolving to:
Example Responses
Payment Response:
Payment Status Response:
Best Practices
Keep your keys secure: Never expose your
apiKey
orsecretKey
in frontend applications. Use environment variables or a secure backend to manage these keys.Validate Inputs: Ensure all customer details and payment amounts are validated before initiating a payment.
Error Handling: Implement proper error handling to manage failed requests or API errors.
Support
For questions or support, contact us at support@zenopay.net
License
This project is licensed under the MIT License.
---# ZenoPay-Node.js-Package
Last updated