PHP code example of yield-tech / sdk-php

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

    

yield-tech / sdk-php example snippets


// For security, don't save the actual key in your code or repo
$client = new YieldTech\SdkPhp\Client(getenv('YIELD_API_KEY'));

// Fetch an existing order
$order = $client->order->fetch('ord_...');
print_r($order->customer->registeredName);

// Or create a new one
$newOrder = $client->order->create([
    'customer_id' => 'org_...',
    'total_amount' => 'PHP 1234.50',
    'note' => 'Test order from the PHP SDK!',
]);