Skip to content

Commit d7b6466

Browse files
committed
Get tracking url from SendCloud API
1 parent d4acad7 commit d7b6466

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Picqer/Carriers/SendCloud/Parcel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Parcel extends Model
4545
'data',
4646
'country',
4747
'shipment',
48+
'reference',
4849
'requestShipment',
4950
'order_number',
5051
'tracking_number',
@@ -69,6 +70,12 @@ class Parcel extends Model
6970

7071
public function getTrackingUrl()
7172
{
73+
// SendCloud now gives us this undocumented field, so if it exists use this
74+
if ( ! empty($this->tracking_url)) {
75+
return $this->tracking_url;
76+
}
77+
78+
// Otherwise build url based on old method
7279
$shipper = $this->getShipperName();
7380

7481
switch ($shipper) {

0 commit comments

Comments
 (0)