gemy / mygift-api
using for mygift-api
1.0.0
2023-10-25 08:57 UTC
Requires
- php: >=7.0
- laravel/framework: >=7.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
My Gift
My Gift is an application to buy discount coupons
Installation
You can install the package via composer:
composer require gemy/mygift-api
setup Database
to setup my gift setting:
php artisan my-gift:setup
setup Slug
to save your slug on my gift:
php artisan my-gift:slug
The status codes
These are the codes that will be returned to you in the event of success or failure:
| status | the meaning |
|---|---|
| 200 | This code exists, use the data in “data” |
| 404 | This code is invalid |
| 406 | you must send the code |
| 407 | you must send the slug |
| 408 | This code has already been used |
| 409 | This code has expired |
This is the code when the status is 200
if "type" = "per" It means that it is a percentage, and when it is with "value" it means that it is just a value
The code
use it as a trait
use Gemy\MygiftApi\App\MyGiftApi; class HomeController extends Controller { use MyGiftApi; public function checkIfCodeExists() { $response = $this->checkIfCodeExists('code', 'slug'); //put your code here } public function useCoupon() { $response = $this->useCoupon('code', 'slug','your order id','The discount value after the calculation'); //put your code here } }
