Wallogit.com
2017 © Pedro Peláez
There's nothing overly complex about this package - it's just a wrapper around the API. Example usage code below., (*1)
The following functions are available on the \Trustico\API class:, (*2)
This code requires PHP >= 5.5., (*3)
Supports both Composer installation and regular file inclusion. For Composer, add the following to your composer.json:, (*4)
"require": {
"phil-lavin/trustico": "dev-master"
}
For Composer, the library's classes will autoload if you use Composer's autoloader., (*5)
If you don't use Composer, just include src/autoloader.php into your app. This adds an SPL autoloader and you can call classes as required., (*6)
<?php
$api = \Trustico\API::forge('user', 'pass');
$response = $api->hello("This is a test message");
if (!$response->is_success()) {
die("Error...\n".$response->get_errors_string()."\n");
}
foreach ($response->get_data() as $k=>$v) {
var_dump("$k => $v");
}
It's largely self documenting cause it's just a wrapper., (*7)
See the \Trustico\API class for the methods you can call. They're an exact mapping to the API methods documented at https://resellers.trustico.com/geodirect/admin/api-overview.php. You need to be logged into a Reseller account to see the Trustico docs., (*8)
All the methods should be self explanitory. process_order_type_1() and process_order_type_2() take an array of data keyed by the field names described in the Trustico API docs., (*9)
All methods will return a \Trustico\Response\XML\General except get_approver_list() which returns a \Trustico\Response\XML\ApproverList. The ApproverList response implements a get_emails() generator method (for you to foreach over) which parses the slightly silly Trustico API response into a list of e-mail addresses., (*10)