2017 © Pedro Peláez
 

library transdirect

A minimal implementation of Transdirect Public API v4

image

sudiptpa/transdirect

A minimal implementation of Transdirect Public API v4

  • Monday, December 25, 2017
  • by sudiptpa
  • Repository
  • 1 Watchers
  • 1 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

A minimal implementation of Transdirect API v4.

Build Status StyleCI Latest Stable Version Total Downloads License, (*1)

Transdirect is Australia wide delivering solutions for you, this package covers a minimal PHP implementation of the Transdirect REST API. It contains only the endpoints documented at http://docs.transdirectapiv4.apiary.io., (*2)

Installation

You can install the package via composer: Composer., (*3)

composer require sudiptpa/transdirect

And run composer to update your dependencies:, (*4)

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Usage

The first thing you need to do is get the API token from Transdirect, you will need to specify the requesting domain to get valid API response data., (*5)

Here are a few examples on how you can use the package:, (*6)

  $client = new Sujip\Transdirect\Transdirect($apiKey);  

Also have a look in the source code of Sujip\Transdirect\Transdirect to discover the methods you can use. You will need to visit Official REST API documentation for the parameters to specify with each end point., (*7)

If you wish to make a direct call to API end point for your own custom implementation, you can use the $client->make('member', $parameters); method., (*8)

    $parameters = [
        'declared_value' => '1000.00',
        'referrer' => 'API',
        'requesting_site' => 'http://www.test.com.au',
        'tailgate_pickup' => true,
        'tailgate_delivery' => true,
        'items' => [
            ['weight' => '38.63',
                'height' => '0.25',
                'width' => '1.65',
                'length' => '3.32',
                'quantity' => 1,
                'description' => 'carton',
            ],
            [
                'weight' => '39.63',
                'height' => '1.25',
                'width' => '2.65',
                'length' => '4.32',
                'quantity' => 2,
                'description' => 'carton',
            ],
        ],
        'sender' => [
            'address' => '21 Kirksway Place',
            'company_name' => 'Test Company',
            'email' => 'sender@test.com',
            'name' => 'Sujip Thapa',
            'postcode' => '2000',
            'phone' => 123456789,
            'state' => '',
            'suburb' => 'SYDNEY',
            'type' => 'business',
            'country' => 'AU',
        ],
        'receiver' => [
            'address' => '216 Moggill Rd',
            'company_name' => 'Test Receiver',
            'email' => 'receiver@test.com',
            'name' => 'John Smith',
            'postcode' => '3000',
            'phone' => 123456789,
            'state' => '',
            'suburb' => 'MELBOURNE',
            'type' => 'business',
            'country' => 'AU',
        ],
    ];

  $response = $client->createBooking($parameters);
  $quotes = $response->getQuotes();
  $josn = $response->toJson();
  $bookingId = $response->getId();
  $statusCode = $response->getCode();

Changelog

Please see CHANGELOG for more information what has changed recently., (*9)

Contributing

Contributions are welcome and will be fully credited., (*10)

Contributions can be made via a Pull Request on Github., (*11)

Testing

If you would like to look at the real time response comming from live or mock server with transdirect REST API endpoints browse http://docs.transdirectapiv4.apiary.io, (*12)

Support

If you are having general issues with the package, feel free to drop me and email sudiptpa@gmail.com, (*13)

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., (*14)

The Versions

25/12 2017

dev-master

9999999-dev

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

05/07 2017

1.6.0

1.6.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

10/06 2017

dev-patch-8

dev-patch-8

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

10/06 2017

1.5.0

1.5.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

04/05 2017

1.4.0

1.4.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

02/05 2017

1.3.0

1.3.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

01/05 2017

1.2.0

1.2.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect

30/04 2017

1.0.0

1.0.0.0

A minimal implementation of Transdirect Public API v4

  Sources   Download

MIT

The Requires

 

The Development Requires

api transdirect