Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: DeliveryDate missing from request #100

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

gsdkkr
Copy link
Contributor

@gsdkkr gsdkkr commented Sep 11, 2024

PR for issue #99

According to PostNL's Documentation, ShippingDate isn't a valid parameter for the request. Instead, the documentation says to use DeliveryDate.

The DeliveryDate parameter only accepts a value following the DD-MM-YYYY format, which is the following pattern:

^[0-3]\d-[0-1]\d-[1-2]\d{3}$

To follow this pattern, and because you can't pass a DateTimeInterface type in the request, I formatted the return value (from the getDeliveryDate method) to follow the DD-MM-YYYY pattern.

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.
@firstred
Copy link
Owner

Thanks so much for the fix! I'll make a new release asap.

@firstred firstred merged commit c306538 into firstred:v2.0.x Sep 18, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants