PHP code example of gigasavvy / liteview-api

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

    

gigasavvy / liteview-api example snippets


use Liteview\Connection;

$connection = new Connection('username', 'key');

// Get all supported order methods.
$orderResponse = $connection->get('order/methods');

// Submit a new order
$connection->post('order/submit', $xmlString);

use Liteview\Connection;
use Liteview\Api\Resources\Resource;
use Liteview\Api\Resources\ResourceLoader;

// Create a new Resource instance using the ResourceLoader, which
// converts the given XML file to an associative array.
$order = Resource::create(new ResourceLoader('order_submit.xml'));

$order->set('order_status', 'Active');

$connection = new Connection('username', 'key');
$connection->post('order/submit', $order->toXml());

string array_to_xml(array $data, SimpleXMLElement &$xml)

array xml_to_array(mixed $xml)

bool is_assoc(array $arr)