PHP code example of bmcfarlin / gigwage-php-sdk

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





igWage\Client;

$client = new Client();


igWage\Client;

$client = new Client("your_api_key", "your_api_secret", "your_gigwage_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 200 at a time


igWage\Client;

$client = new Client();
$json = $client->contractor->list();


igWage\Client;

$client = new RestClient();
$payments = [];
$json = $client->contractor->list();
$item = json_decode($json);
foreach($item->contractors as $contractor){
  $debit_card = false;
  $line_items = [['amount' => 15.00, 'reason' => 'Testing', 'reimbursement' => false]];
  $payment = ['contractor_id' => $contractor->id, 'debit_card' => $debit_card, 'line_items' => $line_items];
  $payments[] = $payment;
}
$data = ['payments' => $payments];
$data['nonce'] = hash('sha256', json_encode($data));
$json = $client->batch->create($data);


igWage\Client;

$amount = 1000.00;
$direction = 'fund';
$data = ['amount' => $amount, 'direction' => $direction];
$data['nonce'] = hash('sha256', json_encode($data));
$json = $client->transfer->create($data);