A sample Billing API built with ASP.NET Core, demonstrating clean architecture, design patterns and JWT authentication.
- Install .NET 9 SDK.
- Clone the repository.
- Set BillingApi as Startup project.
- Run IIS Express.
- Open Swagger UI: https://localhost:xxxx/swagger.
- Login with default user:
POST /auth/login { "username": "test", "password": "1234" }
- Copy the returned JWT token.
- In Swagger, click Authorize and paste:
Bearer <your_token>
- POST /orders → Create a new order
- GET /orders/history → View user’s orders and receipts
Gateways:
paypal→ always succeedsstripe→ always fails
dotnet testTests cover:
- BillingService (success/failure/validation)
- PaymentGatewayFactory
- In-memory repositories
- User login validation