- Docker
- Docker Compose
- PHP 8.1
- Composer
- Nginx
- Clone the repository
- Run
composer install
- Create a
.env
file and update with your database and PayFast credentials - Run
php artisan migrate
- Run
php artisan serve
- Endpoint:
POST /api/payments
- Parameters:
amount
,currency
,customer_email
- Response:
{ "redirect_url": "https://www.payfast.co.za/eng/process?... }
- Endpoint:
POST /api/payments/ipn
- Parameters:
pf_payment_id
,amount_gross
- Response:
{ "status": "success" }
- Run
php artisan test
The Swagger YAML document can be accessed at: http://127.0.0.1:8000/api/documentation
- Used Laravel for robust and easy API development.
- JWT for authentication for secure API access.
- Mocked PayFast IPN handler for simplicity.
- Dockerized the application for easy setup and consistent development environment.