1.x-dev
1.9999999.9999999.9999999-devWeb-IT GLS-ADE SDK
The Requires
- php >=5.3.3
- doctrine/collections ~1.2
- doctrine/cache ~1.2
- jms/serializer ~0.13|~1.0
- webit/soap-api ~1.0
The Development Requires
by Daniel Bojdo
Web-IT GLS-ADE SDK
The repository provides a client to communicate with GLS SOAP APIs, (*1)
Add the webit/gls-ade into composer.json, (*2)
{ "require": { "webit/gls-ade": "^2.0.0" } }
use Webit\GlsAde\Model\AdeAccount; use \Webit\GlsAde\Api\Factory\ApiFactory; $adeAccount = new AdeAccount('your-login', 'your-password', 'is-test-env' ? true : false); $apiFactory = ApiFactory::create(); /** @var \Webit\GlsAde\Api\AuthApi $authApi */ $authApi = $apiFactory->createAuthApi(); /** @var \Webit\GlsAde\Api\ConsignmentPrepareApi $consignemntPrepareApi */ $consignemntPrepareApi = $apiFactory->createConsignmentPrepareApi($adeAccount); /** @var \Webit\GlsAde\Api\MpkApi $mpkApi */ $mpkApi = $apiFactory->createMpkApi($adeAccount); /** @var \Webit\GlsAde\Api\PickupApi $pickupApi */ $pickupApi = $apiFactory->createPickupApi($adeAccount); /** @var \Webit\GlsAde\Api\PostalCodeApi $postalCodeApi */ $postalCodeApi = $apiFactory->createPostalCodeApi($adeAccount); /** @var \Webit\GlsAde\Api\ProfileApi $profileApi */ $profileApi = $apiFactory->createProfileApi($adeAccount); /** @var \Webit\GlsAde\Api\SenderAddressApi $senderAddressApi */ $senderAddressApi = $apiFactory->createSenderAddressApi($adeAccount); /** @var \Webit\GlsAde\Api\ServiceApi $serviceApi */ $serviceApi = $apiFactory->createServiceApi($adeAccount);
For real life example see examples directory., (*3)
cd examples cp config.php.dist config.php
Set your account details in config.php then run examples, (*4)
sh
php auth.php
php mpk.php
php post-codes.php
php profile.php
php sender.php
php services.php
, (*5)
To run all tests (including real API calls tests), copy phpunit.xml.dist file to phpunit.xml and replace username / password. If you don't do this, API tests will be skipped., (*6)
./vendor/bin/phpunit
Web-IT GLS-ADE SDK