Thanks to visit codestin.com
Credit goes to github.com

Skip to content

davidgg090/paymentAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Gateway API

This is a simple payment gateway API that allows you to make payments and retrieve payment details.

alt text

Installation

Create a virtual environment and install the requirements using the following commands:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Create a .env file in the root directory and add the following environment variables:

DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
DB_NAME=
SECRET_KEY=
ALGORITHM=

Usage

To run the server, use the following command:

python main.py

The server will be running on http://127.0.0.1:8000/

Check the API documentation at http://12.0.0.1:8000/api/v1/docs

Testing

To run the tests, use the following command:

pytest

Docker

To run the server using docker, use the following commands:

docker build -t payment-gateway-api .
docker run --env-file .env p 8000:80 payment-gateway-api

Database

Open the file execute_sql.sh and replace the environment variables with the correct values for your database.

DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=

For create the tables for the database, make it executable the file in folder script call execute_sql.sh with the following command in the terminal:

chmod +x execute_sql.sh

Then, execute the file with the following command:

./execute_sql.sh

Technologies

  • FastAPI
  • PostgreSQL
  • Docker
  • Pytest
  • SQLAlchemy

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages