Skip to content

Commit 233f6bd

Browse files
gsdkkrfirstred
authored andcommitted
Fix: DeliveryDate missing from request
ShippingDate isn't a parameter, according to PostNL's Documentation: - https://developer.postnl.nl/docs/#/http/api-endpoints/checkout-delivery-options/deliverydate/calculate-shipping-date DeliveryDate parameter only accepts dd-mm-yyyy format, which is the following pattern: - ^[0-3]\d-[0-1]\d-[1-2]\d{3}$ So I formatted the DateTimeInterface (returned by the getDeliveryDate method) to oblidge by that format.
1 parent 8c9d2a5 commit 233f6bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Service/DeliveryDateService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public function buildGetSentDateRequestREST(GetSentDateRequest $getSentDate)
464464

465465
$sentDate = $getSentDate->getGetSentDate();
466466
$query = [
467-
'ShippingDate' => $sentDate->getDeliveryDate(),
467+
'DeliveryDate' => $sentDate->getDeliveryDate()->format('d-m-Y'),
468468
];
469469
$query['CountryCode'] = $sentDate->getCountryCode();
470470
if ($duration = $sentDate->getShippingDuration()) {

0 commit comments

Comments
 (0)