Skip to content

Commit

Permalink
Add movement type, requested by @joelwmale
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbmarshall committed Mar 9, 2022
1 parent 5a22028 commit bef6ff9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Shipment {
public $customer_reference_1 = '';
public $customer_reference_2 = '';
public $email_tracking_enabled = true;
public $movement_type = 'DESPATCH';
public $from;
public $to;
public $parcels = [];
Expand All @@ -49,6 +50,7 @@ public function setTo($data) {
$this->to = $data;
return $this;
}

/**
* Add the From address
* @param Address $data The address to send from
Expand All @@ -59,6 +61,16 @@ public function setFrom($data) {
return $this;
}

/**
* Set the movement type
* @param string $data 'DESPATCH' or 'RETURN' or 'TRANSFER'
* @return $this
*/
public function setMovementType($data) {
$this->movement_type = $data;
return $this;
}

public function addParcel($data) {
$this->parcels[] = $data;
return $this;
Expand Down Expand Up @@ -117,6 +129,7 @@ public function lodgeShipment() {
'customer_reference_1' => $this->customer_reference_1,
'customer_reference_2' => $this->customer_reference_2,
'email_tracking_enabled' => $this->email_tracking_enabled,
'movement_type' => $this->movement_type,
'from' => [
'name' => $this->from->name,
'business_name' => $this->from->business_name,
Expand Down

0 comments on commit bef6ff9

Please sign in to comment.