Skip to content

Commit ef2d16a

Browse files
authored
Merge pull request #5 from MonoWTF/master
Add bda field to parcel response
2 parents 9edde34 + eac459f commit ef2d16a

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

src/Adapters/ParcelAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ public static function parseAddResponse(string $response): array
416416
$response->setParcelType((string)$parcel->TipoCollo);
417417
$response->setGlsDestinationAbbr((string)$parcel->SiglaSedeDestino);
418418
$response->setPrinter((string)$parcel->Sprinter);
419+
$response->setBda((string)$parcel->Bda);
419420
$response->setTotalPackages((int)$parcel->TotaleColli);
420421
$responseObjects[] = $response;
421422
}

src/Responses/AddParcelResponse.php

Lines changed: 19 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, $pickUpDelivery, $pickUpPoint, $error;
24+
private $printer, $Bda, $totalPackages, $pickUpDelivery, $pickUpPoint, $error;
2525

2626
/**
2727
* Parcel id setter
@@ -455,6 +455,24 @@ public function getPrinter(): string
455455
return $this->printer;
456456
}
457457

458+
/**
459+
* Bda setter
460+
* @param string $bda
461+
*/
462+
public function setBda(string $Bda): void
463+
{
464+
$this->Bda = $Bda;
465+
}
466+
467+
/**
468+
* Bda getter
469+
* @return string
470+
*/
471+
public function getBda(): string
472+
{
473+
return $this->Bda;
474+
}
475+
458476
/**
459477
* Total Packages setter
460478
* @param string $totalPackages

src/Services/ParcelService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function list(Auth $auth): array
4343
* @param Auth $auth Instance of the Auth object
4444
* @param String $status - Null for all states
4545
* - 0 for parcels awaiting closure
46-
* - 1 for closed parcels
46+
* - 1 for closed parcels
4747
* @return array List of parcels
4848
*/
4949
public static function listByStatus(Auth $auth, String $status = ""): array
@@ -60,8 +60,8 @@ public static function listByStatus(Auth $auth, String $status = ""): array
6060
* form "date to". If "date to" is not specified, then the current date is used.
6161
* Hours and minutes are optional.
6262
* @param Auth $auth Instance of the Auth object
63-
* @param String $dateFrom The format should be YYYYMMDDHHII (year-month-day-hour-minute)
64-
* @param String $dateTo The format should be YYYYMMDDHHII (year-month-day-hour-minute)
63+
* @param String $dateFrom The format should be YYYYMMDDHHII (year-month-day-hour-minute)
64+
* @param String $dateTo The format should be YYYYMMDDHHII (year-month-day-hour-minute)
6565
* @return array List of parcels
6666
*/
6767
public static function listByPeriod(Auth $auth, String $dateFrom = "", String $dateTo = ""): array
@@ -92,10 +92,10 @@ public static function add(Auth $auth, array $parcels): array
9292
$xmlData['Parcel__'.$i] = (array)$parcelAdapter->get();
9393
$i++;
9494
}
95-
95+
9696
$xmlData = array_merge((array)$authAdapter->get(), $xmlData);
9797
$xml = new \SimpleXMLElement('<Info/>');
98-
static::toXml($xml, $xmlData);
98+
static::toXml($xml, $xmlData);
9999
$result = static::get('AddParcel', ['XMLInfoParcel' => $xml->asXML()]);
100100

101101
return ParcelAdapter::parseAddResponse($result);

0 commit comments

Comments
 (0)