PHP code example of voov / billingo-api-datamapper

1. Go to this page and download the library: Download voov/billingo-api-datamapper 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/ */

    

voov / billingo-api-datamapper example snippets


use Billingo\API\Connector\HTTP\Request;
use Billingo\API\DataMapper\BillingoFactory;

$client = new Request([
    'public_key' => 'YOUR_PUBLIC_KEY',
    'private_key' => 'YOUR_PRIVATE_KEY',
]);
$factory = new BillingoFactory($client);

use Billingo\API\DataMapper\Models\Clients;
$clients = $factory->make(Clients::class)->loadAll();

$vat = $factory->makeFromName('vat')->loadAll();

$client = $factory->make(Clients::class)->load('12344567');

use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class);

// you can either use magic variables
$client->name = 'Test Client Co.';

// or simple fill the whole model with an array
$client->fill([
  'name' => 'Test Client Co.'
  // ...
]);

$client->save();

use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class)->load('12344567');
$client->name = 'Test Client Updated Co.';
$client->save();

use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class)->load('12344567')->delete();

use Billingo\API\DataMapper\Models\Invoices;
$invoice = $factory->make(Invoices::class)->load('12344567');
$invoice->pay(3500, 1);

public function pay($amount, $paymentMethodId, $date=null)

public function cancel()

public function send()