royal-mail-tracking

A PHP library for accessing the Royal Mail Tracking API V2 (REST) API.

MIT License

Downloads
2.6K
Stars
4
Committers
1
royal-mail-tracking - 4.2.0 Latest Release

Published by elliotjreed 2 months ago

Adds optional parameter for specifying the base API endpoint, eg:

$tracking = (new \ElliotJReed\RoyalMail\Tracking\Events(
    new \GuzzleHttp\Client(),
    'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
    '12345678901234567890123456789012345678901234567890',
    true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
    true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
    'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
$signature = (new \ElliotJReed\RoyalMail\Tracking\Signature(
    new \GuzzleHttp\Client(),
    'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
    '12345678901234567890123456789012345678901234567890',
    true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
    true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
    'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
$summary = (new \ElliotJReed\RoyalMail\Tracking\Summary(
    new \GuzzleHttp\Client(),
    'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
    '12345678901234567890123456789012345678901234567890',
    true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
    true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
    'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
royal-mail-tracking - 4.1.0

Published by elliotjreed 7 months ago

Fixes exception getResponse() return type to allow null

royal-mail-tracking - 3.0.0

Published by elliotjreed over 1 year ago

Sets minimum required PHP version to 8.1 (PHP 8.0 no longer supported).

royal-mail-tracking - 2.4.0

Published by elliotjreed over 1 year ago

  • Catches authorisation error in Event
  • Fixes deprecation warning in PHP 8.2 for self reference in callback
Package Rankings
Top 29.58% on Packagist.org
Badges
Extracted from project README
Contributor Covenant
Related Projects