PHP code example of bmcfarlin / worldnet-php-sdk

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

    

bmcfarlin / worldnet-php-sdk example snippets





ldnet = new Worldnet\Client();


ldnet = new Worldnet\Client(WORLDNET_API_KEY, WORLDNET_API_URL);


$client->resources->create($params) # Create
$client->resources->get($id) # Get
$client->resources->update($id, $params) # Update
$client->resources->delete($id) # Delete
$client->resources->list() # List all resources, max 100 at a time


ldnet = new Worldnet\Client();
$items = $worldnet->terminal->list();
foreach($items->data as $item){
  $json = json_encode($item, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
  print("$json\n");
}


ldnet = new Worldnet\Client();
$terminal = "xxxxxx";
$items = $worldnet->transaction->search($terminal);
foreach($items->data as $item){
  $json = json_encode($item, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
  print("$json\n");
}


ldnet = new Worldnet\Client();
$items = $worldnet->reporting->list();
foreach($items->data as $item){
  $json = json_encode($item, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
  print("$json\n");
}