@@ -15,8 +15,8 @@ class Auspost {
1515 private $ api_key = null ;
1616 private $ api_password = null ;
1717 private $ account_number = null ;
18+ private $ raw_account = null ;
1819 private $ test_mode = null ;
19- private $ star_track = null ;
2020
2121 const API_SCHEME = 'tls:// ' ;
2222 const API_HOST = 'digitalapi.auspost.com.au ' ;
@@ -35,20 +35,19 @@ class Auspost {
3535 public function __construct ($ api_key , $ api_password , $ account_number , $ test_mode = false ) {
3636 $ this ->api_key = $ api_key ;
3737 $ this ->api_password = $ api_password ;
38+ $ this ->raw_account = $ account_number ;
3839 $ this ->account_number = str_pad ($ account_number , 10 , '0 ' , STR_PAD_LEFT ); // Ensure the account number is zero padded 10 digits
3940 $ this ->test_mode = $ test_mode ;
4041 }
41-
42+
4243 /**
4344 * Flags the Auspost instance as StarTrack
4445 *
45- * @param string $account_number The StarTrack Account number
46- * @return void
46+ * @return self
4747 */
48- public function starTrack ($ account_number )
49- {
50- $ this ->star_track = true ;
51- $ this ->account_number = $ account_number ;
48+ public function useStarTrack () {
49+ $ this ->account_number = $ this ->raw_account ;
50+ return $ this ;
5251 }
5352
5453 /**
0 commit comments