This is a REST Service implemented using SlimPHP framework
- Web server with URL rewriting
- PHP 5.5 or newer
The best way to install Slim framework is using Composer. Once Composer is installed you can run:
composer require slim/slim "^3.0"
The service is available at http://<'your-host'>/<'your-app'>/api/discount/
One should send a HTTP POST request. Sending data is required.
The logic is represented by 3 main methods:
- discountForSwitchesCategory(...$args)
- discountForToolsCategory(...$args)
- discountOnTotalAmount()