Skip to content

Commit db3ad41

Browse files
Merge pull request #2 from hirani89/master
Add Star Track support
2 parents bef6ff9 + 44aa0fe commit db3ad41

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Auspost.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Auspost {
1616
private $api_password = null;
1717
private $account_number = null;
1818
private $test_mode = null;
19+
private $star_track = null;
1920

2021
const API_SCHEME = 'tls://';
2122
const API_HOST = 'digitalapi.auspost.com.au';
@@ -37,6 +38,18 @@ public function __construct($api_key, $api_password, $account_number, $test_mode
3738
$this->account_number = str_pad($account_number, 10, '0', STR_PAD_LEFT); // Ensure the account number is zero padded 10 digits
3839
$this->test_mode = $test_mode;
3940
}
41+
42+
/**
43+
* Flags the Auspost instance as StarTrack
44+
*
45+
* @param string $account_number The StarTrack Account number
46+
* @return void
47+
*/
48+
public function starTrack($account_number)
49+
{
50+
$this->star_track = true;
51+
$this->account_number = $account_number;
52+
}
4053

4154
/**
4255
* Perform a GetAccounts API call.

src/Shipment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ public function addParcel($data) {
8484
public function getQuotes() {
8585
$request = [
8686
'from' => [
87+
'suburb' => $this->from->suburb,
8788
'postcode' => $this->from->postcode,
8889
'country' => $this->from->country,
8990
],
9091
'to' => [
92+
'suburb' => $this->to->suburb,
9193
'postcode' => $this->to->postcode,
9294
'country' => $this->to->country,
9395
],

0 commit comments

Comments
 (0)