cjario/omniship-royal-mail

Royal Mail Shipping Carrier for Omniship

dev-master 2018-12-16 19:05 UTC

This package is auto-updated.

Last update: 2024-04-17 08:40:20 UTC


README

Royal Mail driver for the Omniship PHP shipping carrier library

Omniship is a framework agnostic, multi-carrier shipping library for PHP. This package implements Royal Mail support for Omniship.

Installation

Omniship is installed via Composer. To install, simply require cjario/omniship-royal-mail with Composer:

composer require cjario/omniship-royal-mail

Basic Usage

The following carriers are provided by this package:

  • Royal Mail

For general usage instructions, please see the main Omniship repository.

Basic example

$carrier = \Omniship\Omniship::create('RoyalMail');  
$carrier->initialize([
    'clientId' => Yii::$app->params['clientId'],
    'clientSecret' => Yii::$app->params['clientSecret']
]);


// Get the JWT token for authorization
$resp = $carrier->token([
    'username' => Yii::$app->params['username'],
    'password' => Yii::$app->params['password']
])->send();


 print_r($resp->getData());

Support

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.