diff --git a/CHANGELOG.md b/CHANGELOG.md index 458bea0..9113c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.5.0 - 2026-05-05 +- Single-shipment-per-order now uses merchant default parcel size from settings instead of summing item dimensions +- Added `getDefaultParcelWidth/Height/Length/Weight` to `PayseraDeliverySettingsInterface` +- `ShipmentsAdapter::convert()` signature changed: now accepts `PayseraDeliverySettingsInterface` instead of a bool flag + ## 0.4.0 - 2026-02-18 - Add credentials validation feature diff --git a/composer.lock b/composer.lock index d363673..822c6b6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9e280e905711636a02b67ee4bf68e0cf", + "content-hash": "60e4bf6fabaf31e3af822a03eac5ea2c", "packages": [ { "name": "evp/money", @@ -101,22 +101,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.10.0", + "version": "7.9.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", - "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^2.3", - "guzzlehttp/psr7": "^2.8", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -207,7 +207,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" }, "funding": [ { @@ -223,20 +223,20 @@ "type": "tidelift" } ], - "time": "2025-08-23T22:36:01+00:00" + "time": "2025-03-27T13:37:11+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.3.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "481557b130ef3790cf82b713667b43030dc9c957" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", - "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -244,7 +244,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.44 || ^9.6.25" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -290,7 +290,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.3.0" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -306,20 +306,20 @@ "type": "tidelift" } ], - "time": "2025-08-22T14:34:08+00:00" + "time": "2025-03-27T13:27:01+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.8.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "21dc724a0583619cd1652f673303492272778051" + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", - "reference": "21dc724a0583619cd1652f673303492272778051", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", "shasum": "" }, "require": { @@ -335,7 +335,7 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.44 || ^9.6.25" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -406,7 +406,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.8.0" + "source": "https://github.com/guzzle/psr7/tree/2.7.1" }, "funding": [ { @@ -422,7 +422,7 @@ "type": "tidelift" } ], - "time": "2025-08-23T21:21:41+00:00" + "time": "2025-03-27T12:30:47+00:00" }, { "name": "maba/math", @@ -570,16 +570,16 @@ }, { "name": "paysera/lib-rest-client-common", - "version": "2.7.2", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/paysera/lib-rest-client-common.git", - "reference": "7698353254fa73d16415e1c0ef98ea0af3c4b6c8" + "reference": "57b581abba953ed8ac956035c1e937d0e9cef3ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paysera/lib-rest-client-common/zipball/7698353254fa73d16415e1c0ef98ea0af3c4b6c8", - "reference": "7698353254fa73d16415e1c0ef98ea0af3c4b6c8", + "url": "https://api.github.com/repos/paysera/lib-rest-client-common/zipball/57b581abba953ed8ac956035c1e937d0e9cef3ea", + "reference": "57b581abba953ed8ac956035c1e937d0e9cef3ea", "shasum": "" }, "require": { @@ -603,9 +603,9 @@ "description": "Base classes/helpers used in REST Clients", "support": { "issues": "https://github.com/paysera/lib-rest-client-common/issues", - "source": "https://github.com/paysera/lib-rest-client-common/tree/2.7.2" + "source": "https://github.com/paysera/lib-rest-client-common/tree/2.7.1" }, - "time": "2025-07-23T13:14:38+00:00" + "time": "2025-03-17T09:53:44+00:00" }, { "name": "psr/container", @@ -933,16 +933,16 @@ }, { "name": "webtopay/libwebtopay", - "version": "3.1.5", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/paysera/lib-webtopay.git", - "reference": "2e70d938097cee5ef817362416865b0e80a77ce0" + "reference": "950e8149839815ffc5dca6384cdea0bc3d12de79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paysera/lib-webtopay/zipball/2e70d938097cee5ef817362416865b0e80a77ce0", - "reference": "2e70d938097cee5ef817362416865b0e80a77ce0", + "url": "https://api.github.com/repos/paysera/lib-webtopay/zipball/950e8149839815ffc5dca6384cdea0bc3d12de79", + "reference": "950e8149839815ffc5dca6384cdea0bc3d12de79", "shasum": "" }, "require": { @@ -982,9 +982,9 @@ "description": "PHP Library for Paysera payment gateway integration", "support": { "issues": "https://github.com/paysera/lib-webtopay/issues", - "source": "https://github.com/paysera/lib-webtopay/tree/3.1.5" + "source": "https://github.com/paysera/lib-webtopay/tree/3.1.1" }, - "time": "2025-08-05T11:28:10+00:00" + "time": "2025-01-21T08:16:44+00:00" } ], "packages-dev": [ @@ -1061,16 +1061,16 @@ }, { "name": "composer/semver", - "version": "3.4.4", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { @@ -1122,7 +1122,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.4" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -1132,9 +1132,13 @@ { "url": "https://github.com/composer", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "time": "2025-08-20T19:15:30+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -1276,7 +1280,6 @@ "issues": "https://github.com/doctrine/annotations/issues", "source": "https://github.com/doctrine/annotations/tree/1.14.4" }, - "abandoned": true, "time": "2024-09-05T10:15:52+00:00" }, { @@ -1566,20 +1569,20 @@ }, { "name": "hamcrest/hamcrest-php", - "version": "v2.1.1", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", - "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", "shasum": "" }, "require": { - "php": "^7.4|^8.0" + "php": "^5.3|^7.0|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -1587,8 +1590,8 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" }, "type": "library", "extra": { @@ -1611,9 +1614,9 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" }, - "time": "2025-04-30T06:54:44+00:00" + "time": "2020-07-09T08:09:16+00:00" }, { "name": "mockery/mockery", @@ -1700,16 +1703,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.4", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", - "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -1748,7 +1751,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -1756,20 +1759,20 @@ "type": "tidelift" } ], - "time": "2025-08-01T08:46:24+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", - "version": "v5.7.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -1788,7 +1791,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1812,9 +1815,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2025-12-06T11:56:16+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -2037,11 +2040,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.32", + "version": "1.12.23", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "29201e7a743a6ab36f91394eab51889a82631428" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", - "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/29201e7a743a6ab36f91394eab51889a82631428", + "reference": "29201e7a743a6ab36f91394eab51889a82631428", "shasum": "" }, "require": { @@ -2086,7 +2094,7 @@ "type": "github" } ], - "time": "2025-09-30T10:16:31+00:00" + "time": "2025-03-23T14:57:32+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -2558,16 +2566,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.31", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/945d0b7f346a084ce5549e95289962972c4272e5", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -2578,7 +2586,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.4", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -2589,11 +2597,11 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.9", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.6", "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.8", - "sebastian/global-state": "^5.0.8", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", "sebastian/object-enumerator": "^4.0.4", "sebastian/resource-operations": "^3.0.4", "sebastian/type": "^3.2.1", @@ -2641,7 +2649,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.31" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -2652,20 +2660,12 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2025-12-06T07:45:52+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psr/cache", @@ -2985,16 +2985,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.9", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -3047,27 +3047,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", - "type": "tidelift" } ], - "time": "2025-08-10T06:51:50+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -3257,16 +3245,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.8", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", - "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -3322,40 +3310,28 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", - "type": "tidelift" } ], - "time": "2025-09-24T06:03:27+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.8", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", - "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -3398,27 +3374,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", - "type": "tidelift" } ], - "time": "2025-08-10T07:10:35+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", @@ -3591,16 +3555,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.6", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", - "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -3642,27 +3606,15 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", - "type": "tidelift" } ], - "time": "2025-08-10T06:57:39+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -4288,7 +4240,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -4347,7 +4299,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -4358,10 +4310,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4371,16 +4319,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { @@ -4429,7 +4377,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -4440,20 +4388,16 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-06-27T09:58:17+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -4514,7 +4458,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -4525,10 +4469,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4538,7 +4478,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -4599,7 +4539,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -4610,10 +4550,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4688,7 +4624,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -4744,7 +4680,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" }, "funding": [ { @@ -4755,10 +4691,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4768,7 +4700,7 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", @@ -4828,7 +4760,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -4839,10 +4771,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4852,7 +4780,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.33.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -4908,7 +4836,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { @@ -4919,10 +4847,6 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4994,16 +4918,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.6.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", - "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -5057,7 +4981,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -5068,16 +4992,12 @@ "url": "https://github.com/fabpot", "type": "github" }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-07-15T11:30:57+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/stopwatch", @@ -5143,16 +5063,16 @@ }, { "name": "symfony/string", - "version": "v6.4.30", + "version": "v6.4.24", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "50590a057841fa6bf69d12eceffce3465b9e32cb" + "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/50590a057841fa6bf69d12eceffce3465b9e32cb", - "reference": "50590a057841fa6bf69d12eceffce3465b9e32cb", + "url": "https://api.github.com/repos/symfony/string/zipball/f0ce0bd36a3accb4a225435be077b4b4875587f4", + "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4", "shasum": "" }, "require": { @@ -5166,6 +5086,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", "symfony/http-client": "^5.4|^6.0|^7.0", "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", @@ -5208,7 +5129,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.30" + "source": "https://github.com/symfony/string/tree/v6.4.24" }, "funding": [ { @@ -5228,20 +5149,20 @@ "type": "tidelift" } ], - "time": "2025-11-21T18:03:05+00:00" + "time": "2025-07-10T08:14:14+00:00" }, { "name": "theseer/tokenizer", - "version": "1.3.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", - "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -5270,7 +5191,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -5278,17 +5199,17 @@ "type": "github" } ], - "time": "2025-11-17T20:03:58+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], - "minimum-stability": "dev", - "stability-flags": {}, + "minimum-stability": "stable", + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": ">=7.4" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/src/Adapter/OrderCreateRequestAdapter.php b/src/Adapter/OrderCreateRequestAdapter.php index 9581584..5e4f158 100644 --- a/src/Adapter/OrderCreateRequestAdapter.php +++ b/src/Adapter/OrderCreateRequestAdapter.php @@ -45,7 +45,7 @@ public function convert(PayseraDeliveryOrderRequest $request): OrderCreate ->setShipmentMethodCode( $this->gatewayUtils->getShipmentMethodCode($deliveryGateway->getSettings()) ) - ->setShipments([...$this->shipmentsAdapter->convert($orderDto->getItems(), $request->getDeliverySettings()->isSinglePerOrderShipmentEnabled())]) + ->setShipments([...$this->shipmentsAdapter->convert($orderDto->getItems(), $request->getDeliverySettings())]) ->setReceiver( $this->shipmentPointAdapter->convert( $orderDto->getShipping(), diff --git a/src/Adapter/OrderUpdateRequestAdapter.php b/src/Adapter/OrderUpdateRequestAdapter.php index be0594d..d56855e 100644 --- a/src/Adapter/OrderUpdateRequestAdapter.php +++ b/src/Adapter/OrderUpdateRequestAdapter.php @@ -45,7 +45,7 @@ public function convert(PayseraDeliveryOrderRequest $request): OrderUpdate ->setShipmentMethodCode( $this->gatewayUtils->getShipmentMethodCode($deliveryGateway->getSettings()) ) - ->setShipments([...$this->shipmentsAdapter->convert($orderDto->getItems(), $request->getDeliverySettings()->isSinglePerOrderShipmentEnabled())]) + ->setShipments([...$this->shipmentsAdapter->convert($orderDto->getItems(), $request->getDeliverySettings())]) ->setReceiver( $this->shipmentPointAdapter->convert( $orderDto->getShipping(), diff --git a/src/Adapter/ShipmentsAdapter.php b/src/Adapter/ShipmentsAdapter.php index 4c7b6e8..713b67d 100644 --- a/src/Adapter/ShipmentsAdapter.php +++ b/src/Adapter/ShipmentsAdapter.php @@ -7,6 +7,7 @@ use Paysera\DeliveryApi\MerchantClient\Entity\ShipmentCreate; use Paysera\DeliverySdk\Collection\OrderItemsCollection; use Paysera\DeliverySdk\Entity\MerchantOrderItemInterface; +use Paysera\DeliverySdk\Entity\PayseraDeliverySettingsInterface; class ShipmentsAdapter { @@ -16,38 +17,29 @@ class ShipmentsAdapter */ public function convert( OrderItemsCollection $items, - bool $isSinglePerOrderShipmentEnabled = false + PayseraDeliverySettingsInterface $deliverySettings ): iterable { - if ($isSinglePerOrderShipmentEnabled) { - return $this->createSingleShipment($items); + if ($deliverySettings->isSinglePerOrderShipmentEnabled()) { + if (count($items) === 0) { + return []; + } + return $this->createSingleShipment($deliverySettings); } return $this->createMultipleShipments($items); } /** - * @param OrderItemsCollection $items + * @param PayseraDeliverySettingsInterface $deliverySettings * @return iterable */ - private function createSingleShipment(OrderItemsCollection $items): iterable + private function createSingleShipment(PayseraDeliverySettingsInterface $deliverySettings): iterable { - $width = 0; - $height = 0; - $length = 0; - $weight = 0; - - foreach ($items as $item) { - $width += $item->getWidth(); - $height += $item->getHeight(); - $length += $item->getLength(); - $weight += $item->getWeight(); - } - return [ (new ShipmentCreate()) - ->setLength((int) ceil($length)) - ->setWidth((int) ceil($width)) - ->setHeight((int) ceil($height)) - ->setWeight((int) ceil($weight)), + ->setLength($deliverySettings->getDefaultParcelLength()) + ->setWidth($deliverySettings->getDefaultParcelWidth()) + ->setHeight($deliverySettings->getDefaultParcelHeight()) + ->setWeight($deliverySettings->getDefaultParcelWeight()), ]; } diff --git a/src/Entity/PayseraDeliverySettingsInterface.php b/src/Entity/PayseraDeliverySettingsInterface.php index d84dae3..f764fc5 100644 --- a/src/Entity/PayseraDeliverySettingsInterface.php +++ b/src/Entity/PayseraDeliverySettingsInterface.php @@ -24,4 +24,12 @@ public function isHouseNumberFieldEnabled(): ?bool; public function getUserAgent(): string; public function isSinglePerOrderShipmentEnabled(): bool; + + public function getDefaultParcelWidth(): int; + + public function getDefaultParcelHeight(): int; + + public function getDefaultParcelLength(): int; + + public function getDefaultParcelWeight(): int; } diff --git a/tests/Adapter/ShipmentsAdapterTest.php b/tests/Adapter/ShipmentsAdapterTest.php index e27906a..ba85c8a 100644 --- a/tests/Adapter/ShipmentsAdapterTest.php +++ b/tests/Adapter/ShipmentsAdapterTest.php @@ -33,7 +33,7 @@ public function testConvertWithMultipleShipments(): void ->method('isSinglePerOrderShipmentEnabled') ->willReturn(false); - $shipments = [...$this->shipmentsAdapter->convert($this->itemsCollection)]; + $shipments = [...$this->shipmentsAdapter->convert($this->itemsCollection, $this->settingsMock)]; $this->assertCount(2, $shipments); @@ -56,8 +56,12 @@ public function testConvertWithSingleShipment(): void $this->settingsMock ->method('isSinglePerOrderShipmentEnabled') ->willReturn(true); + $this->settingsMock->method('getDefaultParcelLength')->willReturn(100); + $this->settingsMock->method('getDefaultParcelWidth')->willReturn(80); + $this->settingsMock->method('getDefaultParcelHeight')->willReturn(60); + $this->settingsMock->method('getDefaultParcelWeight')->willReturn(120); - $shipments = [...$this->shipmentsAdapter->convert($this->itemsCollection, true)]; + $shipments = [...$this->shipmentsAdapter->convert($this->itemsCollection, $this->settingsMock)]; $this->assertCount(1, $shipments); $shipment = $shipments[0]; @@ -68,6 +72,17 @@ public function testConvertWithSingleShipment(): void $this->assertEquals(120, $shipment->getWeight()); } + public function testConvertWithSingleShipmentReturnsNothingWhenItemsAreEmpty(): void + { + $this->settingsMock + ->method('isSinglePerOrderShipmentEnabled') + ->willReturn(true); + + $shipments = [...$this->shipmentsAdapter->convert(new OrderItemsCollection([]), $this->settingsMock)]; + + $this->assertCount(0, $shipments); + } + private function createItemMock(int $height, int $width, int $length, int $weight): MerchantOrderItemInterface { $mock = $this->createMock(MerchantOrderItemInterface::class);