Skip to content

Commit 82ebcb8

Browse files
committed
Adds support for the pickup points deliveries
1 parent 2ce8c65 commit 82ebcb8

3 files changed

Lines changed: 121 additions & 5 deletions

File tree

src/Adapters/ParcelAdapter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ final class ParcelAdapter extends BaseAdapter
212212
'getter' => 'getAdditionalPrivacyText',
213213
'xmlElement' => 'InfoPrivacy',
214214
'maxLength' => 50
215+
],
216+
[
217+
'getter' => 'getPickUpDelivery',
218+
'xmlElement' => 'FermoDeposito',
219+
'maxLength' => 1
220+
],
221+
[
222+
'getter' => 'getPickUpPoint',
223+
'xmlElement' => 'SiglaSedeFermoDeposito',
224+
'maxLength' => 4
215225
]
216226
]
217227
];

src/Models/Parcel.php

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,40 @@ final class Parcel extends BaseModel
393393
*/
394394
private $additionalPrivacyText = 'Per info sul trattamento dati personali www.gls-italy.com/privacydest';
395395

396+
/**
397+
* Enabling pickup point delivery provided by the GLS Italy DepotPickupService.
398+
* Link: https://gls-group.com/IT/it/spedire-ricevere/servizio-per-te/servizi-accessori/depotpickup.
399+
*
400+
* s = enable pickup point delivery.
401+
* Any other value or empty = option disabled.
402+
*
403+
* Max length is 1.
404+
*
405+
* From the GLS documentation:
406+
* Se “s” allora attiva il calcolo del “Fermo Deposito” usando l’indirizzo
407+
* specificato per identificare la sigla sede di Fermo Deposito
408+
*
409+
* @var string
410+
*/
411+
private $pickUpDelivery;
412+
413+
/**
414+
* The actual pickup point where recipient will get the parcel.
415+
* For this to work the $pickUp needs to be set to 's' ( enabled ).
416+
*
417+
* To get the identifier of the pickup point, you should use CheckAddress GLS Italy Service.
418+
* https://checkaddress.gls-italy.com/wscheckaddress.asmx
419+
*
420+
* Max length is 4.
421+
*
422+
* @var string
423+
*
424+
* From the GLS documentation:
425+
* I valori ammessi sono le sigle sedi GLS che fanno fermo deposito
426+
* (verificare mediante metodo CheckDepotPickUp() )
427+
*/
428+
private $pickUpPoint;
429+
396430
/**
397431
* Status setter
398432
* @param string $status
@@ -494,9 +528,9 @@ public function setPostcode(string $value): void
494528

495529
/**
496530
* Postcode getter
497-
* @return string
531+
* @return string|null
498532
*/
499-
public function getPostcode(): string
533+
public function getPostcode(): ?string
500534
{
501535
return $this->postcode;
502536
}
@@ -584,9 +618,9 @@ public function setWeight(string $value): void
584618

585619
/**
586620
* Weight getter
587-
* @return string
621+
* @return string|null
588622
*/
589-
public function getWeight(): string
623+
public function getWeight(): ?string
590624
{
591625
return $this->weight;
592626
}
@@ -950,4 +984,40 @@ public function getAdditionalPrivacyText(): ?string
950984
{
951985
return $this->additionalPrivacyText;
952986
}
987+
988+
/**
989+
* PickUpDelivery setter
990+
* @param string $value
991+
*/
992+
public function setPickUpDelivery(string $value): void
993+
{
994+
$this->pickUpDelivery = $value;
995+
}
996+
997+
/**
998+
* PickUpDelivery getter.
999+
* @return string|null
1000+
*/
1001+
public function getPickUpDelivery(): ?string
1002+
{
1003+
return $this->pickUpDelivery;
1004+
}
1005+
1006+
/**
1007+
* PickUpPoint setter
1008+
* @param string $value
1009+
*/
1010+
public function setPickUpPoint(string $value): void
1011+
{
1012+
$this->pickUpPoint = $value;
1013+
}
1014+
1015+
/**
1016+
* PickUpPoint setter
1017+
* @param string $value
1018+
*/
1019+
public function getPickUpPoint(): ?string
1020+
{
1021+
return $this->pickUpPoint;
1022+
}
9531023
}

src/Responses/AddParcelResponse.php

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class AddParcelResponse extends BaseResponse
2121
private $parcelId, $pdfLabel, $zplLabel, $senderName, $volumeWeight, $shippingDate, $glsDestination, $csm, $areaCode;
2222
private $infoPrivacy, $receiverName, $address, $city, $province, $description1, $description2, $shippingWeight;
2323
private $shippingNotes, $transportType, $senderInitials, $progressiveParcel, $parcelType, $glsDestinationAbbr;
24-
private $printer, $totalPackages, $error;
24+
private $printer, $totalPackages, $pickUpDelivery, $pickUpPoint, $error;
2525

2626
/**
2727
* Parcel id setter
@@ -473,6 +473,42 @@ public function getTotalPackages(): string
473473
return $this->totalPackages;
474474
}
475475

476+
/**
477+
* pickUpDelivery setter.
478+
* @param string $pickUpDelivery
479+
*/
480+
public function setPickUpDelivery(string $pickUpDelivery): void
481+
{
482+
$this->pickUpDelivery = $pickUpDelivery;
483+
}
484+
485+
/**
486+
* pickUpDelivery getter.
487+
* @return string
488+
*/
489+
public function getPickUpDelivery(): string
490+
{
491+
return $this->pickUpDelivery;
492+
}
493+
494+
/**
495+
* pickUpPoint setter.
496+
* @param string $pickUpPoint
497+
*/
498+
public function setPickUpPoint(string $pickUpPoint): void
499+
{
500+
$this->pickUpPoint = $pickUpPoint;
501+
}
502+
503+
/**
504+
* pickUpPoint getter.
505+
* @return string
506+
*/
507+
public function getPickUpPoint(): string
508+
{
509+
return $this->pickUpPoint;
510+
}
511+
476512
/**
477513
* Errors setter
478514
* @param string $error

0 commit comments

Comments
 (0)