PHP code example of abumutrust / utrust
1. Go to this page and download the library: Download abumutrust/utrust 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/ */
abumutrust / utrust example snippets
use AbumUtrust\ApiClient;
$utrustApi = new ApiClient('API_KEY');
$orderData = [...];
$customerData = [...];
$response = $utrustApi->createOrder($orderData, $customerData);
echo $response->attributes->redirect_url;
$orderIsValid = Validator::order($orderData);
$customerIsValid = Validator::customer($customerData);
if ($orderIsValid && $customerIsValid) {
// create the order here
}
$event = new Event($payload);
$event->validateSignature($webhooksSecret);