PHP code example of vendloop / vendloop-php

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

    

vendloop / vendloop-php example snippets






use Vendloop\VendloopClient;

$vendloop = new \Vendloop\VendloopClient('sk_live_aa873dabc21fba4d45762bf0b18b56d79a18e37b');
try {
    $customer = $vendloop->customers->fetch([
        'id' => 12
    ]);
    echo $customer;
} catch(\Vendloop\Exception\ApiException $e){
    die($e->getMessage());
}

$vendloop = new \Vendloop\VendloopClient([
    'api_key' => 'sk_live_aa873dabc21fba4d45f0b18b56d79a18e37762bb', // your api key
    'base_url' => 'https://api.vendloop.com', // to change the endpoint URL to a mock server
    'use_guzzle' => false // if true, use guzzle for API calls (guzzle should be installed)
]);
bash
composer