Skip to content

Commit 9edde34

Browse files
authored
Merge pull request #4 from pihlersimon/feature-add-support-for-pickup-points
Adds support for the pickup points deliveries
2 parents bb73205 + b281964 commit 9edde34

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
@@ -213,6 +213,16 @@ final class ParcelAdapter extends BaseAdapter
213213
'xmlElement' => 'InfoPrivacy',
214214
'maxLength' => 50
215215
],
216+
[
217+
'getter' => 'getPickUpDelivery',
218+
'xmlElement' => 'FermoDeposito',
219+
'maxLength' => 1
220+
],
221+
[
222+
'getter' => 'getPickUpPoint',
223+
'xmlElement' => 'SiglaSedeFermoDeposito',
224+
'maxLength' => 4
225+
],
216226
[
217227
'getter' => 'getShipmentType',
218228
'xmlElement' => 'TipoSpedizione',

src/Models/Parcel.php

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

396396
/**
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+
430+
/*
397431
* Shipment type (used for international shipments)
398432
* P = Parcel
399433
* N = National (default)
@@ -523,9 +557,9 @@ public function setPostcode(string $value): void
523557

524558
/**
525559
* Postcode getter
526-
* @return string
560+
* @return string|null
527561
*/
528-
public function getPostcode(): string
562+
public function getPostcode(): ?string
529563
{
530564
return $this->postcode;
531565
}
@@ -631,9 +665,9 @@ public function setWeight(string $value): void
631665

632666
/**
633667
* Weight getter
634-
* @return string
668+
* @return string|null
635669
*/
636-
public function getWeight(): string
670+
public function getWeight(): ?string
637671
{
638672
return $this->weight;
639673
}
@@ -998,6 +1032,42 @@ public function getAdditionalPrivacyText(): ?string
9981032
return $this->additionalPrivacyText;
9991033
}
10001034

1035+
/**
1036+
* PickUpDelivery setter
1037+
* @param string $value
1038+
*/
1039+
public function setPickUpDelivery(string $value): void
1040+
{
1041+
$this->pickUpDelivery = $value;
1042+
}
1043+
1044+
/**
1045+
* PickUpDelivery getter.
1046+
* @return string|null
1047+
*/
1048+
public function getPickUpDelivery(): ?string
1049+
{
1050+
return $this->pickUpDelivery;
1051+
}
1052+
1053+
/**
1054+
* PickUpPoint setter
1055+
* @param string $value
1056+
*/
1057+
public function setPickUpPoint(string $value): void
1058+
{
1059+
$this->pickUpPoint = $value;
1060+
}
1061+
1062+
/**
1063+
* PickUpPoint setter
1064+
* @param string $value
1065+
*/
1066+
public function getPickUpPoint(): ?string
1067+
{
1068+
return $this->pickUpPoint;
1069+
}
1070+
10011071
/**
10021072
* Reference persona name needed for international shipments
10031073
*

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)