All Projects → fontis → auspost-api-php

fontis / auspost-api-php

Licence: LGPL-3.0 license
Australia Post API client library for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to auspost-api-php

readabs
Download and tidy time series data from the Australian Bureau of Statistics in R
Stars: ✭ 73 (+121.21%)
Mutual labels:  australia
school-finder
👀 Find schools by location
Stars: ✭ 16 (-51.52%)
Mutual labels:  australia
Australian-Open-Banking-Data-Database
This is an ongoing collection of Open Banking Data APIs for Australian deposit taking institutions.
Stars: ✭ 72 (+118.18%)
Mutual labels:  australia
life-in-australia
完美主义程序员的澳洲生活分享(适用于留学、技术移民以及雇主担保移民等)https://kenberkeley.github.io
Stars: ✭ 20 (-39.39%)
Mutual labels:  australia
addressr
Free Australian Address Validation, Search and Autocomplete
Stars: ✭ 46 (+39.39%)
Mutual labels:  australia
census-loader
A quick way to get started with ABS Census 2016 data
Stars: ✭ 32 (-3.03%)
Mutual labels:  australia
pancake
Making npm work for the front end and the Australian Government Design System.
Stars: ✭ 93 (+181.82%)
Mutual labels:  australia
census-100-people
Census 2016: This is Australia as 100 people
Stars: ✭ 13 (-60.61%)
Mutual labels:  australia
performance-dashboard
Performance Dashboard for Australian Government https://dashboard.gov.au
Stars: ✭ 12 (-63.64%)
Mutual labels:  australia
coronavirus-stats
Automatically scrape data and statistics on Coronavirus to make them easily accessible in CSV format
Stars: ✭ 47 (+42.42%)
Mutual labels:  australia
APAC-Meetups
A community contributed consolidated list of InfoSec meetups in the Asia Pacific region.
Stars: ✭ 52 (+57.58%)
Mutual labels:  australia
ausbills
🇦🇺 This is a package for obtaining parliament bills for Australian governments.
Stars: ✭ 24 (-27.27%)
Mutual labels:  australia

Auspost API Client Library for PHP

This library is a Guzzle-based client for integrating PHP applications with Australia Post's web services.

Documentation on how to use this library can be found in the Postage Assessment Calculation and Postcode Search and the Delivery Choices specifications.

Table of Contents

Getting Started

Register to use Australia Post services

You will need to apply for an API key if you want to use the Postage Assessment Calculator and Postcode Search services. Similarly, you will also need to apply for permission to use the [Delivery Choices] dce-registration service.

Minimum requirements

  1. PHP 5.3.10 compiled with the cURL extension
  2. cURL 7.22.0

Note: The library is likely to work with earlier versions of PHP and cURL, but they have not been tested.

Install using Composer

  1. Add fontis/auspost-api-php as a Composer dependency in your project's composer.json file:

    {
        "require": {
            "fontis/auspost-api-php": "*"
        }
    }
  2. Download and install Composer into the repo:

    $ curl -sS https://getcomposer.org/installer | php
  3. Install the library dependencies:

    $ php composer.phar install
  4. Add the library to your PHP application:

    require_once 'vendor/autoload.php';

Install using Git

  1. Clone this repo to an appropriate location:

    $ git clone https://github.com/fontis/auspost-api-php
  2. Download and install Composer into the repo:

    $ cd auspost-api-php
    $ curl -sS https://getcomposer.org/installer | php
  3. Install the library dependencies:

    $ php composer.phar install
  4. Add the library to your PHP application:

    require_once 'vendor/autoload.php';

Quick Example

Calculate domestic parcel postage cost

<?php
require 'vendor/autoload.php';

use Auspost\Common\Auspost;
use Auspost\Postage\Enum\ServiceCode;

// Instantiate a Postage Assessment Calculator service
$client = Auspost::factory('/path/to/config.php')->get('postage');

$result = $client->calculateDomesticParcelPostage(array(
    'from_postcode' => 3000,
    'to_postcode' => 3011,
    'length' => 10,
    'width' => 10,
    'height' => 10,
    'weight' => 10,
    'service_code' => ServiceCode::AUS_PARCEL_REGULAR
));

Contributions

This project is open source. You are encouraged to fork and submit pull requests.

Guidelines

Please ensure your code adheres to the following guidelines in order for your pull request to be accepted.

  1. Follow the PHP-FIG standards recommendations - This library is written with adherence to the PSR-0, PSR-1 and PSR-2 standard recommendations.
  2. Write unit tests - Any new functionality should include corresponding tests.
  3. Add the licence header to new files - We would appreciate having licence headers been added to the top of new files.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].