Skip to content

Mike-Jagger/zippay_integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZipPay Payment Gateway Integration

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

Table of Contents

Installation

  1. Clone the repository:
    git clone https://github.com/Mike-Jagger/zippay_integration.git
    cd zippay_integration
  2. 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

Environment Variables

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

Running the Servers

  1. Run the Mock Server:
    cd zippayAPI
    node server.js
  2. Run the Backend Server:
    cd ../backend
    node server.js

Running the React App

  1. Start the React Application:
    cd ../frontend
    npm start
  2. You should see something similar to this demo opening on your default web browser:

Testing with Postman

To test the payout functionality with Postman:

  1. Open Postman and create a new POST request.
  2. Set the request URL to:
    http://localhost:5000/payment/payout
  3. 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
    }
  4. Send the request. You should receive a response similar to:
    {
        "code": 200,
        "msg": "SUCCESS",
        "success": true,
        "data": {
            "merchantId": "84",
            "timestamp": "1717286626735"
        }
    }

Future Implementations

  • 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.

Licensing

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

Contributing

Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors