Updates for one shipment per oder#7
Merged
Conversation
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # composer.lock # src/Adapter/OrderCreateRequestAdapter.php # src/Adapter/OrderUpdateRequestAdapter.php # src/Adapter/ShipmentsAdapter.php # src/Entity/PayseraDeliverySettingsInterface.php # tests/Adapter/ShipmentsAdapterTest.php
There was a problem hiding this comment.
Code Review
This pull request updates the shipment creation logic to use merchant-defined default parcel dimensions for single-shipment orders instead of summing individual item dimensions. Key changes include updates to the ShipmentsAdapter, the PayseraDeliverySettingsInterface, and the corresponding request adapters. Feedback from the review suggests adding a check to prevent creating shipments for empty orders in single-shipment mode and improving PHPDoc documentation for better static analysis.
maksym-k-p
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body:
Summary
dimensions/weight from settings instead of summing every item's
dimensions (which produced unrealistic shipment sizes).
PayseraDeliverySettingsInterfacewithgetDefaultParcelWidth/Height/Length/Weight().ShipmentsAdapter::convert()now takes the fullPayseraDeliverySettingsInterfaceinstead of aboolflag, so it canread both the toggle and the default parcel size from one source.
CHANGELOG.md.Changes
src/Adapter/ShipmentsAdapter.php—createSingleShipment()readsdefaults from settings; signature of
convert()updated.src/Adapter/OrderCreateRequestAdapter.php,src/Adapter/OrderUpdateRequestAdapter.php— passDeliverySettingsto
ShipmentsAdapter::convert().src/Entity/PayseraDeliverySettingsInterface.php— 4 new getters.tests/Adapter/ShipmentsAdapterTest.php— updated to new signatureand asserts the parcel uses the defaults from settings.
Breaking changes
ShipmentsAdapter::convert()signature changed from(OrderItemsCollection, bool)to(OrderItemsCollection, PayseraDeliverySettingsInterface).Any implementer of
PayseraDeliverySettingsInterfacemust add the fournew
getDefaultParcel*()methods.Test plan
composer test(PHPUnit) passesshipment with the merchant's default parcel dimensions