We are implementing an e-wallet payment system with a robust 3-tier architecture featuring React, Flask, Stripe and Firebase.
- Introduction
- Features
- Technology Stack
- Getting Started
- Configuration
- Usage
- API Documentation
- Contribution
- License
Blazepay is a modern and secure payment application designed to simplify financial transactions. It allows users to send and receive payments, split bills, and manage multi-currency transactions. Blazepay integrates with Stripe for secure payment processing and utilizes a React frontend, Flask backend, and Firestore database for seamless communication and data storage.
Blazepay offers the following key features:
-
Multi-Currency Support: Users can perform transactions in multiple currencies, making it suitable for international transactions.
-
Peer-to-Peer (P2P) Transactions: Users can send money to their contacts securely through the app.
-
Group Transactions: Users can split bills and expenses with friends or colleagues, making group payments hassle-free.
-
Stripe Payment Integration: Blazepay integrates with Stripe's payment gateway for safe and secure payment processing.
-
Top-Up Functionality: Users can easily top up their Blazepay account using Stripe API.
Blazepay utilizes the following technology stack:
- Frontend: React
- Backend: Flask
- Database: Firestore
- Payment Integration: Stripe
Before setting up Blazepay, ensure you have the following prerequisites installed:
The API uses JSON Web Tokens (JWT) for authentication. To access protected routes, include a valid JWT token in the request headers.
The base URL for the API is http://localhost:8000
.
- Endpoint:
/data
- Method:
POST
- Description: Retrieve user data.
- Authentication: JWT required.
- Request Body: None
- Response:
- Success (200 OK):
{ "message": "PIN matches, data returned", "user_data": { // User data fields } }
- Error (500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/profile
- Method:
POST
- Description: Retrieve user profile data.
- Authentication: JWT required.
- Request Body:
phone
(string): User phone numberpin
(string): User PIN
- Response:
- Success (200 OK):
{ "message": "PIN matches, data returned", "user_data": { // User data fields (excluding PIN and salt) }, "access_token": "JWT access token" }
- Error (500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/payment
- Method:
POST
- Description: Create a peer-to-peer (P2P) transaction.
- Authentication: JWT required.
- Request Body:
receiver
(string): Receiver's usernameamount
(float): Transaction amountcurrency
(string): Currency code (e.g., USD)
- Response:
- Success (200 OK):
{ "message": "Transfer transaction created successfully" }
- Error (500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/newUser
- Method:
POST
- Description: Create a new user account.
- Authentication: None
- Request Body:
email
(string): User email addressname
(string): User namephone
(string): User phone numberpin
(string): User PINcurrency
(array of strings): Supported currencies
- Response:
- Success (200 OK):
{ "message": "User registered successfully" }
- Error (400 Bad Request or 500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/topUp
- Method:
POST
- Description: Top up a user's account balance.
- Authentication: JWT required.
- Request Body:
amount
(float): Top-up amountcurrency
(string): Currency code (e.g., USD)
- Response:
- Success (200 OK):
{ "stripe_url": "Stripe checkout URL", "sessionId": "Stripe session ID" }
- Error (500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/group
- Method:
POST
- Description: Create a group transaction.
- Authentication: JWT required.
- Request Body:
name
(string): Group namemembers
(array of strings): Usernames of group membersamount
(float): Transaction amountcurrency
(string): Currency code (e.g., USD)
- Response:
- Success (200 OK):
{ "message": "Group Payment has been created successfully" }
- Error (400 Bad Request or 500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/group/check
- Method:
POST
- Description: Check and modify group payment distribution (for the group requestor).
- Authentication: JWT required.
- Request Body:
group_id
(string): Group transaction IDdistribution
(object): New distribution of payments
- Response:
- Success (200 OK):
{ "message": "Group Payment has been updated successfully" }
- Error (400 Bad Request or 500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/group/payment
- Method:
POST
- Description: Process group payments (for group members).
- Authentication: JWT required.
- Request Body:
group_id
(string): Group transaction ID
- Response:
- Success (200 OK):
{ "message": "I paid my part, thank you" }
- Error (400 Bad Request or 500 Internal Server Error):
{ "error": "Error message" }
- Success (200 OK):
- Endpoint:
/webhook
- Method:
POST
- Description: Handle Stripe webhook events (e.g., successful payments).
- Authentication: None
- Request Body: Stripe webhook payload
- Response:
- Success (200 OK): Acknowledgment of successful processing.
- Error (400 Bad Request or 500 Internal Server Error): Error messages.
In case of an error, the response JSON will include an error
field with an error message.
The project was contributed by Victor, Ricky, JunLe, and YinYu
This project is licensed under the MIT License. See the LICENSE file for details.