PHP code example of pagantis / module-utils

1. Go to this page and download the library: Download pagantis/module-utils 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/ */

    

pagantis / module-utils example snippets


composer 



//Amount mismatch Example
try {
    if ($price1 != $price2) {
        throw new AmountMismatchException($price1, $price2);
    }
} catch(AmountMismatchException $e) {
    $jsonResponse = new JsonExceptionResponse();
    $jsonResponse->setException($e);
    $jsonResponse->toJson();
}