This is a Node.js application that demonstrates an e-commerce payment gateway using SSLCommerz. The application uses Express.js for the server, MongoDB as the database, and SSLCommerz for payment processing.
To install the required dependencies, run the following command:
npm install
To start the server, run the following command:
npm start
The server will start on port 3001.
The following environment variables are required:
STORE_ID: The SSLCommerz store ID.
STORE_PASSWD: The SSLCommerz store password.
IS_LIVE: A boolean indicating whether the application is in live mode.
API Endpoints
The following API endpoints are available:
POST /payment: Initiates a payment request.
POST /payment/success/:trans_id: Handles successful payments.
POST /payment/fail/:trans_id: Handles failed payments.
GET /order-details/:userId: Retrieves order details for a user.
Database Schema The application uses MongoDB as the database. The following collections are used:
product: Stores product information. order: Stores order information.