PHP code example of iqv / qliro_php_sdk

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

    

iqv / qliro_php_sdk example snippets


use Qliro\Transport\GuzzleConnector;
use Qliro\MerchantApi\Order;

// Pass true as the third argument to use the test environment.
$connector = new GuzzleConnector('your-api-key', 'your-api-secret', isTest: true);

$order = new Order($connector);
$order->create([
    'MerchantReference'                      => 'ORDER-001',
    'Currency'                               => 'SEK',
    'Country'                                => 'SE',
    'Language'                               => 'sv-SE',
    'MerchantTermsUrl'                       => 'https://example.com/terms',
    'MerchantConfirmationUrl'                => 'https://example.com/confirmation',
    'MerchantOrderManagementStatusPushUrl'   => 'https://example.com/status-push',
    'OrderItems' => [
        [
            'MerchantReference' => 'SKU-001',
            'Description'       => 'Blue sneakers',
            'Quantity'          => 1,
            'UnitPrice'         => 89.90, // Specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99.
        ],
    ],
]);

echo 'Qliro order ID: ' . $order->getId() . PHP_EOL;
bash
composer