webit / gls-ade
Web-IT GLS-ADE SDK
Installs: 6 871
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 5
Open Issues: 0
Requires
- php: >=5.3.3
- doctrine/collections: ~1.2
- jms/serializer: ~1.0
- webit/soap-api: ^2.0.3
Requires (Dev)
- fzaninotto/faker: ^1.6
- phpunit/phpunit: ~4.2
This package is auto-updated.
Last update: 2024-12-20 22:45:52 UTC
README
The repository provides a client to communicate with GLS SOAP APIs
Installation
Add the webit/gls-ade into composer.json
{ "require": { "webit/gls-ade": "^2.0.0" } }
Usage
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);
Running examples
For real life example see examples directory.
cd examples
cp config.php.dist config.php
Set your account details in config.php then run examples
sh php auth.php php mpk.php php post-codes.php php profile.php php sender.php php services.php
Running tests
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.
./vendor/bin/phpunit