Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 798 Bytes

README.md

File metadata and controls

32 lines (18 loc) · 798 Bytes

Service calculating discounts for orders

This is a REST Service implemented using SlimPHP framework

System Requirements

  • Web server with URL rewriting
  • PHP 5.5 or newer

Software requirements

The best way to install Slim framework is using Composer. Once Composer is installed you can run:

composer require slim/slim "^3.0"

REST API endpoint

The service is available at http://<'your-host'>/<'your-app'>/api/discount/

One should send a HTTP POST request. Sending data is required.

Business logic

The logic is represented by 3 main methods:

  • discountForSwitchesCategory(...$args)
  • discountForToolsCategory(...$args)
  • discountOnTotalAmount()