worldoptions / php-sdk
There is no license information available for the latest version (v1.3.13) of this package.
PHP SDK for Ecommerce REST API
v1.3.13
2024-08-21 07:48 UTC
Requires
- laminas/laminas-diactoros: 2.4.1
- php-http/client-common: ^2.5
- php-http/curl-client: ^2.2
- php-http/message: ^1.13
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- dev-main
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- dev-dev
- dev-feature/WG-2170
- dev-feature/WOC-559
- dev-feature/WOC-555
This package is auto-updated.
Last update: 2024-10-25 09:44:16 UTC
README
The World Options SDK for PHP makes it easy for developers to access World Options Web Services in their PHP code, and build robust applications and software. You can get started in minutes by installing the SDK through Composer or by downloading a single zip or phar file from our latest release.
Jump To:
Getting Started
- Sign up for World Options – Before you begin, you need to sign up for an World Options account and retrieve your World Options credentials.
- Minimum requirements – To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 7.1. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL).
- Install the SDK – Using [Composer] is the recommended way to install the
World Options SDK for PHP. The SDK is available via [Packagist] under the
worldoptions/php-sdk
package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:composer require worldoptions/php-sdk
- Using the SDK – The best way to become familiar with how to use the SDK is to read the Documentation. The Quick Examples will help you become familiar with the basic concepts.
Quick Examples
World Options API client
<?php
// Require the Composer autoloader.
require 'vendor/autoload.php';
use WorldOptions\WorldOptions as WorldOptionsApi;
// Instantiate an World Options API client.
$siteUrl = 'http://example.com';
$username = 'WOTest';
$meternumber = 'ddffg3rfdweq22rffeiwijew'; // You can check it on Customer Portal -> Integrations Tab
$worldOptionsApi = new WorldOptionsApi($siteUrl, $username, $meternumber);
Create Shop
<?php
try {
use WorldOptions\WorldOptions as WorldOptionsApi;
use WorldOptions\Model\Shop;
use WorldOptions\Model\Core\Customer;
use WorldOptions\Model\Localization\Country;
$siteUrl = 'http://example.com';
$api = new WorldOptionsApi($siteUrl);
$customer = new Customer();
$customer->setUsername("WOTest");
$customer->setPassword("WOTestPSW");
$customer->setMeternumber("ddffg3rfdweq22rffeiwijew");
$country = new Country();
$country->setCode("GB");
$customer->setCountry($country);
$shop = new Shop();
$shop->setUrl($url);
$shop->setPlatform(Shop::PLATFORM_CUSTOM);
$shop->setCustomer($customer);
/**
* @return WorldOptions\Model\Shop
*/
$shop = $api->shops()->authorize($shop);
} catch (WorldOptions\Utils\ResponseException $e) {
echo "There was an error when try creating shop.\n";
}
Getting Help
If you have any problems, found a security issue, please contact the maintainers directly at arkadiusz.tobiasz@theifactory.com.