PHP code example of gemy / mygift-api

1. Go to this page and download the library: Download gemy/mygift-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gemy / mygift-api example snippets

bash
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
    }
}