A secure and scalable backend service built with ASP.NET Core for handling payments and transactions in the Agricon ecosystem.
Agricon backend provides RESTful APIs for Payment initialization and verification, Transaction management (CRUD, status update) and Webhook event handling (e.g., Paystack)
- Create new transactions
- View transaction details
- Paginated listing of all transactions
- Filter transactions by user
- Update transaction status
- Get transaction statistics (e.g., total by status or date)
- C# / ASP.NET Core
- Entity Framework Core
- PostgreSQL / SQL Server
- Swagger (OpenAPI 3.0)
- Paystack API
- RESTful architecture
- .NET 8 SDK
- PostgreSQL Server
- Paystack Developer Account
- Clone the repository:
https://github.com/InternPulse/agricon-dotnet-backend.git- Change into the parent directory:
cd agricon- Set appropriate values for the following Compulsory Environment Variables:
# Postgres connection string
DATABASE_URL=""
# Secret key for signing JWTs
JWT_SECRET_KEY=
# API Port
PORT=5000- Apply Migrations:
dotnet ef database update- Run the Application:
dotnet runThe API should now be running locally at http://localhost:7180/
You can explore and test the endpoints via the live Postman documentation:
Here's an overview of available routes:
POST /api/webhook/paystack
POST /api/payment/initiate – Create a new transaction
GET /api/payment/verify/:reference – verify transaction
GET /api/v1/transaction/:id – Get a transaction by ID
PUT /api/v1/transactions/:id/status – Update a transaction
GET /api/v1/transactions/stats – Get overall transaction statistics
GET /api/v1/transaction/usertransactions/:Id – Get transaction stats for a specific booking
- Fork the repo
- Create your branch (git checkout -b feat/feature-name)
- Commit your changes
- Push and open a Pull Request