Card Payment Gateway is a dummy, payment processing solution written in C#. This project is designed to handle card transactions, integrating with multiple payment providers to ensure reliable and seamless transactions.
- Multi-provider integration: Supports multiple payment providers for redundancy and reliability.
- Extensibility: Easily extendable to include additional payment providers or custom features.
Ensure you have the following installed:
- .NET 8.0 SDK
- Docker (for containerized deployment)
- PostgreSQL (recommended database)
-
Clone the repository:
git clone https://github.com/yourusername/card-payment-gateway.git cd card-payment-gateway
-
Set up the database:
Ensure you have PostgreSQL running and create a database for the application. Update the connection string in
appsettings.json
located in thesrc/PaymentGateway.Api
directory. -
Run the application:
cd src/PaymentGateway.Api dotnet run
The application will start and be accessible at
http://localhost:5000
.
To run the application using Docker:
-
Build the Docker image:
docker build -t card-payment-gateway .
-
Run the Docker container:
docker-compose up
The application will start and be accessible at
http://localhost:5000
.
To ensure everything is set up correctly and working as expected, run the test suite:
-
Navigate to the test project:
cd test/PaymentGateway.Api.Tests
-
Run the tests:
dotnet test
After setting up and running the server, you can access the payment gateway API at http://localhost:5000/api/payments
. Refer to the API documentation for details on how to perform transactions and interact with the gateway.
- POST /api/payments: Initiate a new payment.
- GET /api/payments/{id}: Retrieve the status of a specific payment.
You can deploy the application using Docker:
-
Build the Docker image:
docker build -t card-payment-gateway .
-
Run the Docker container:
docker run -d -p 5000:80 card-payment-gateway
Comprehensive API documentation can be generated using tools like Swagger integrated within the project.