Zim-Payconnect is a payment gateway API designed to facilitate secure and efficient transactions in Zimbabwe. It provides a robust platform for processing payments, managing transactions, and ensuring the integrity and security of financial transactions.
- Secure Transactions: Utilizes industry-standard encryption and security protocols to ensure the safety and integrity of transactions.
- User Authentication: Supports user authentication to ensure that only authorized users can access the payment gateway.
- Input Validation: Validates input data to prevent invalid or malicious data from being processed.
- Pagination: Implements pagination for efficient retrieval of large datasets, enhancing performance and user experience.
- Cross-Origin Resource Sharing (CORS): Supports CORS to allow authorized web clients to access the API from different origins.
- Error Handling: Implements comprehensive error handling mechanisms to handle errors gracefully and provide meaningful error messages.
- Rate Limiting: Implements rate limiting to prevent abuse and ensure fair usage of the API resources.
- MongoDB Integration: Integrates with MongoDB for efficient storage and retrieval of transaction data.
To install and run the Zim-Payconnect API locally, follow these steps:
-
Clone the repository:
git clone https://github.com/anesu398/zim-payconnect.git
-
Navigate to the project directory:
cd zim-payconnect
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and define the following variables:PORT=3000 MONGODB_URI=mongodb://localhost:27017/zim-payconnect SECRET_KEY=your_secret_key
-
Start the server:
npm start
Before accessing protected routes, you need to obtain an authentication token by sending a POST request to the /api/auth/login
endpoint with your credentials. The token should be included in the Authorization
header of subsequent requests.
To create a new transaction, send a POST request to the /api/transactions
endpoint with the transaction details in the request body. Make sure to include the authentication token in the Authorization
header.
Example:
http
POST /api/transactions HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Authorization: Bearer your_auth_token
{ "amount": 100.00, "currency": "USD" }
To retrieve transactions, send a GET request to the /api/transactions endpoint. You can use query parameters for pagination.
Example:
http
Copy code
GET /api/transactions?page=1&limit=10 HTTP/1.1
Host: localhost:3000
Authorization: Bearer your_auth_token
For detailed API documentation, refer to the API Documentation page.
Contributions are welcome! Please read the Contribution Guidelines for more information on how to contribute to the project.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all contributors and supporters of the Zim-Payconnect project.