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

International shipping additions #75

Merged
merged 20 commits into from
Mar 24, 2023
Merged

International shipping additions #75

merged 20 commits into from
Mar 24, 2023

Conversation

jbours
Copy link
Contributor

@jbours jbours commented Mar 2, 2023

Changes:

  • Added support for passing the Range parameter for generate barcode request, needed for international S10 barcodes e.g. LA
  • Added support for passing an image of a signature to the generate shipping label request, so it will be printed on the generated label
  • Removed GB from 3S country list, since it is not an EU country anymore

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #75 (e1058a2) into v1.3.x (bd07589) will decrease coverage by 0.12%.
The diff coverage is 80.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             v1.3.x      #75      +/-   ##
============================================
- Coverage     57.45%   57.34%   -0.12%     
- Complexity     2036     2046      +10     
============================================
  Files           114      115       +1     
  Lines          5103     5523     +420     
============================================
+ Hits           2932     3167     +235     
- Misses         2171     2356     +185     
Impacted Files Coverage Δ
src/PostNL.php 62.53% <ø> (+0.10%) ⬆️
src/Entity/Request/GenerateLabel.php 87.09% <66.66%> (-2.56%) ⬇️
src/Service/BarcodeService.php 94.00% <100.00%> (+1.31%) ⬆️
src/HttpClient/BaseHttpClient.php 29.62% <0.00%> (-1.14%) ⬇️
src/Service/AbstractService.php 72.15% <0.00%> (-1.14%) ⬇️
src/HttpClient/GuzzleClient.php 3.73% <0.00%> (-0.66%) ⬇️
src/Util/Message.php 0.00% <0.00%> (ø)
src/Util/TaskQueue.php 0.00% <0.00%> (ø)
src/Util/EachPromise.php 0.00% <0.00%> (ø)
src/Util/PromiseTool.php 0.00% <0.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd07589...e1058a2. Read the comment docs.

@firstred
Copy link
Owner

firstred commented Mar 6, 2023

Thanks so much for the pull request!

Can you tell me which commits I should have a look at? I see commits made by timmtim, but some of these have already either been included or excluded. Have you changed these commits? Or should I only focus on yours?

@jbours
Copy link
Contributor Author

jbours commented Mar 6, 2023

It's sufficient to only focus on the current changes only. the (older) commits have been made on an older fork of this library when it was maintained by thirtybees. We updated our fork with your changes, and backported the features that where missing.

Copy link
Owner

@firstred firstred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me!

I wonder if this may need to be adjusted:

postnl-api-php/src/PostNL.php

Lines 1003 to 1005 in bd07589

if (in_array($type, ['LA', 'UE', 'RI'])) {
$range = 'NL';
} elseif (in_array($type, ['2S', '3S'])) {

Using International Mail & Packets without setting a range should throw an exception instead of setting the range to NL, which is probably invalid anyway.

Anyhow, this should be enough for now to merge the pull request.

Due to the large history of commits in the PR, I'll squash the commits before merging them into the main branch. This PR might then end up having a closed status rather than merged.

Thanks for your contribution!

@firstred firstred merged commit 7149c32 into firstred:v1.3.x Mar 24, 2023
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.

3 participants