This project demonstrates the integration of ZipPay's payment gateway using Node.js and React. It includes a backend server to handle payment requests, a mock server to simulate ZipPay's API, and a frontend application to facilitate user interaction.
For more info on how the project works, please refer to the Full Project Report
- Installation
- Environment Variables
- Running the Servers
- Running the React App
- Testing with Postman
- Future Implementations
- Licensing
- Contributing
- Clone the repository:
git clone https://github.com/Mike-Jagger/zippay_integration.git cd zippay_integration - Install dependencies for both the backend and frontend:
# For backend and mock server cd backend npm install # For frontend cd ../frontend npm install # For mock zippay API cd ../zippayAPI npm install
Source the .env file (using terminal or git bash) in the main repository and configure the necessary environment variables.
For production settings and detailed information, refer to ZipPay's documentation.
cd ..
source .env- Run the Mock Server:
cd zippayAPI node server.js - Run the Backend Server:
cd ../backend node server.js
- Start the React Application:
cd ../frontend npm start - You should see something similar to this demo opening on your default web browser:
.gif)
To test the payout functionality with Postman:
- Open Postman and create a new POST request.
- Set the request URL to:
http://localhost:5000/payment/payout
- Set the request body to:
{ "merchantId": "84", "merchantOrderId": "160032EB8452298", "amount": "100.00", "phone": "1234567890", "email": "test@example.com", "account": "account123", "accountName": "Test Account", "address": "123 Test Street", "subBranch": "Test Branch", "withdrawType": 1, "bankName": "Test Bank", "remark": "Test Remark", "tunnelId": "tunnel123", "currency": "USD", "nonce": "nonce123", "timestamp": 1234567890 } - Send the request. You should receive a response similar to:
{ "code": 200, "msg": "SUCCESS", "success": true, "data": { "merchantId": "84", "timestamp": "1717286626735" } }
- Additional Endpoints: Implement other endpoints provided by ZipPay's API, such as payment inquiries and balance inquiries.
- Enhanced Security: Add more robust security measures and validation.
- Error Handling: Improve error handling and logging for better debugging and maintenance.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.