Skip to content

feat: correct B2B/B2C capabilities via an address-based isBusiness flag - #504

Merged
FreekVR merged 4 commits into
mainfrom
fix/correctly-get-capabilities-for-b2b-and-b2c
Aug 5, 2026
Merged

feat: correct B2B/B2C capabilities via an address-based isBusiness flag#504
FreekVR merged 4 commits into
mainfrom
fix/correctly-get-capabilities-for-b2b-and-b2c

Conversation

@FreekVR

@FreekVR FreekVR commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds support for explicit isBusiness flags based on the adress (a filled company name denotes a B2B shipment, an empty one sets it to false and makes it B2C) and fixes issue where it was set to true instead of null

Note

  • Please rebase-merge so the fix and feat stay as separate commits.

Follow-ups (separate PRs, other repos)

  • js-pdk (admin): forward order.shippingAddress.isBusiness on the proxy capabilities call.
  • delivery-options: config-provided isBusiness boolean on the recipient (no company field on the widget address).
  • PrestaShop: map company into the cart array + reuse the rule in the carrier-list hook. WooCommerce: test-only (its adapter already supplies the company).

Fixes INT-1690

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 10, 2026 12:16
@FreekVR
FreekVR requested a review from a team as a code owner July 10, 2026 12:16
@github-project-automation github-project-automation Bot moved this to Todo in PDK Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect B2B/B2C behavior in capabilities lookups by preserving a true tri-state isBusiness on the wire (true/false/omitted) and by deriving isBusiness from the presence of a recipient company name (without leaking the company into PII-free contexts like the cart/config).

Changes:

  • Ensure capabilities requests omit isBusiness unless explicitly provided by the caller (workaround for generated SDK defaulting to business).
  • Derive and propagate isBusiness from address/company data through order calculators and checkout carrier filtering, while keeping cart context PII-free.
  • Update unit tests and snapshots to reflect the new isBusiness propagation/serialization.

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Unit/SdkApi/Service/CoreApi/Shipment/CapabilitiesServiceTest.php Adds coverage for tri-state isBusiness wire behavior (true/false/omitted).
tests/Unit/Base/Model/ContactDetailsTest.php Verifies ContactDetails derives/updates isBusiness from company.
tests/Unit/Base/Model/AddressTest.php Updates expected address serialization and adds isBusiness derivation tests.
tests/Unit/App/Order/Calculator/CapabilitiesOptionCalculatorTest.php Asserts order capabilities calls send isBusiness based on shipping address company.
tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceCapabilitiesTest.php Asserts checkout carrier-filter capabilities calls include derived isBusiness.
tests/Unit/App/Context/Model/DeliveryOptionsConfigTest.php Ensures checkout config exposes isBusiness to the widget.
tests/Unit/App/Cart/Service/CartCalculationServiceTest.php Updates cart address fixtures to include isBusiness.
tests/snapshots/ShipmentTest__it_returns_empty_fulfilment_shipment_when_no_pdk_shipment_is_passed__1.json Snapshot update: include recipient isBusiness default.
tests/snapshots/ShipmentTest__it_creates_fulfilment_shipment_from_pdk_shipment_with_data_set_shipment_with_all_options__1.json Snapshot update: include recipient isBusiness.
tests/snapshots/ShipmentTest__it_creates_fulfilment_shipment_from_pdk_shipment_with_data_set_empty_shipment__1.json Snapshot update: include recipient isBusiness default.
tests/snapshots/SaveOrderTest__it_creates_a_valid_order_collection_from_api_data_with_data_set_order_with_pickup__1.json Snapshot update: include address isBusiness.
tests/snapshots/SaveOrderTest__it_creates_a_valid_order_collection_from_api_data_with_data_set_order_containing_many_attributes__1.json Snapshot update: include address isBusiness.
tests/snapshots/QueryTest__it_creates_shipment_collection_from_queried_data_with_data_set_shipment_with_pickup__1.json Snapshot update: include isBusiness on sender/recipient.
tests/snapshots/QueryTest__it_creates_shipment_collection_from_queried_data_with_data_set_shipment_with_drop-off_point__1.json Snapshot update: include isBusiness on sender/recipient.
tests/snapshots/QueryTest__it_creates_shipment_collection_from_queried_data_with_data_set_shipment_with_contract__1.json Snapshot update: include isBusiness on sender/recipient.
tests/snapshots/QueryTest__it_creates_shipment_collection_from_queried_data_with_data_set_normal_shipment__1.json Snapshot update: include isBusiness on sender/recipient.
tests/snapshots/QueryTest__it_creates_order_collection_from_queried_data__1.json Snapshot update: include isBusiness in queried order addresses.
tests/snapshots/PostOrdersTest__it_creates_a_valid_order_collection_from_api_data_with_data_set_one_order_with_pickup__1.json Snapshot update: include address isBusiness.
tests/snapshots/PostOrdersTest__it_creates_a_valid_order_collection_from_api_data_with_data_set_one_order_containing_many_attributes__1.json Snapshot update: include address isBusiness.
tests/snapshots/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_with_pickup__1.json Snapshot update: include shippingAddress isBusiness.
tests/snapshots/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_containing_many_attributes__1.json Snapshot update: include shippingAddress isBusiness.
tests/snapshots/OrderTest__it_creates_fulfilment_order_from_pdk_order_with_data_set_order_without_shipments__1.json Snapshot update: include recipient isBusiness.
tests/snapshots/OrderTest__it_creates_fulfilment_order_from_pdk_order_with_data_set_order_with_shipments__1.json Snapshot update: include recipient isBusiness default.
tests/snapshots/OrderTest__it_creates_fulfilment_order_from_pdk_order_with_data_set_empty_order__1.json Snapshot update: include recipient isBusiness default.
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_order_list_column__1.json Snapshot update: include shippingAddress isBusiness.
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_order_box__1.json Snapshot update: include shippingAddress isBusiness.
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_init_script__1.json Snapshot update: include isBusiness and endpoint ordering changes.
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_delivery_options__1.json Snapshot update: include config isBusiness.
tests/snapshots/ExportReturnActionTest__it_exports_return_with_data_set_simple_orders__1.json Snapshot update: include isBusiness on addresses.
tests/snapshots/ExportReturnActionTest__it_exports_return_with_data_set_no_return_capabilities__1.json Snapshot update: include shippingAddress/recipient isBusiness.
tests/snapshots/ExportReturnActionTest__it_exports_return_with_data_set_insurance__1.json Snapshot update: include shippingAddress/recipient isBusiness.
tests/snapshots/CreateReturnShipmentsTest__it_creates_return_shipment_with_data_set_simple_domestic_shipment__1.json Snapshot update: include isBusiness on addresses.
tests/snapshots/ContextServiceTest__it_gets_context_data_with_data_set_single_order__1.json Snapshot update: include shippingAddress isBusiness.
tests/snapshots/ContextServiceTest__it_gets_context_data_with_data_set_multiple_orders__1.json Snapshot update: include shippingAddress isBusiness in context.
tests/snapshots/AccountTest__it_creates_storable_array__1.json Snapshot update: include account address isBusiness.
src/SdkApi/Service/CoreApi/Shipment/CapabilitiesService.php Implements tri-state isBusiness omission workaround before SDK serialization.
src/Context/Model/DeliveryOptionsConfig.php Adds isBusiness to widget config derived from cart shipping address.
src/Carrier/Service/CapabilitiesValidationService.php Threads optional isBusiness through package-type weight aggregation for cache alignment.
src/Base/Model/ContactDetails.php Keeps isBusiness synced when company is set/changed.
src/Base/Model/Address.php Adds isBusiness attribute + derivation rule (company presence → business).
src/App/Order/Calculator/General/InsuranceCalculator.php Uses shared capabilities-recipient builder (includes isBusiness).
src/App/Order/Calculator/General/CapabilitiesPackageTypeCalculator.php Uses shared capabilities-recipient builder (includes isBusiness).
src/App/Order/Calculator/General/CapabilitiesOptionCalculator.php Uses shared capabilities-recipient builder (includes isBusiness).
src/App/Order/Calculator/General/CapabilitiesDeliveryTypeCalculator.php Uses shared capabilities-recipient builder (includes isBusiness).
src/App/Order/Calculator/AbstractPdkOrderOptionCalculator.php Introduces shared capabilitiesRecipient() helper for calculators.
src/App/DeliveryOptions/Service/DeliveryOptionsService.php Ensures checkout carrier filtering and type ordering include isBusiness in capabilities args.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.31%. Comparing base (52a0819) to head (0a88a74).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #504      +/-   ##
============================================
+ Coverage     94.29%   94.31%   +0.01%     
- Complexity     2391     2398       +7     
============================================
  Files           351      351              
  Lines          7663     7689      +26     
============================================
+ Hits           7226     7252      +26     
  Misses          437      437              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

FreekVR added a commit to myparcelnl/js-pdk that referenced this pull request Jul 10, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@myparcel-bot
myparcel-bot Bot force-pushed the fix/correctly-get-capabilities-for-b2b-and-b2c branch from 59994d0 to 3cd2026 Compare July 10, 2026 16:47
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 10, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FreekVR added a commit to myparcelnl/prestashop that referenced this pull request Jul 14, 2026
the checkout now tells the capabilities check whether an order is for a business or a consumer, so each cart sees the carriers and options that apply to it.

The flag comes from whether the delivery address has a company name. The cart repository passes the company to the PDK, which turns it into an isBusiness flag and drops the name (so no personal data is stored), and the carrier-list hook derives the same flag for its own capabilities request. Only the true/false flag is sent, never the company name.

Depends on myparcelnl/pdk#504 — needs a PDK release with the isBusiness flag before this can merge; the tests here rely on it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@myparcel-bot
myparcel-bot Bot force-pushed the fix/correctly-get-capabilities-for-b2b-and-b2c branch from 218db0b to 5809bfe Compare July 16, 2026 09:58
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 16, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 17, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@myparcel-bot
myparcel-bot Bot force-pushed the fix/correctly-get-capabilities-for-b2b-and-b2c branch from 5809bfe to 837c5a2 Compare July 17, 2026 09:08
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 17, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 20, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 20, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 20, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 20, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/App/DeliveryOptions/Service/DeliveryOptionsService.php
FreekVR and others added 4 commits July 21, 2026 10:04
The generated SDK forces isBusiness=true on capabilities recipients when the flag is
unset, so every capabilities request was silently treated as B2B — returning B2B package
types, weight limits and options for consumer shipments. Capabilities requests now omit
isBusiness unless a caller sets it explicitly, letting the API apply its own default.

Temporary workaround for the OpenAPI spec default; see the @todo referencing
myparcelnl/core-api#4658. Explicit true/false values are always respected.

Resolves INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rect capabilities set

Capabilities requests now carry an explicit isBusiness flag derived from whether the
recipient has a company name, so business and consumer shipments receive the delivery
types, package types, weight limits and shipment options that actually apply to them.
The flag flows through the whole order option calculator chain and the checkout carrier
filter, not only the delivery options.

Detection lives in one place on the Address model: a company name yields isBusiness=true,
its absence false. Only the derived boolean — never the company name — travels into the
PII-free cart context, so no personal data leaks there. Context-less queries (weight
aggregation, return support) omit the flag.

Resolves INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SDK beta.30 (sdk#631) defaults isBusiness to null, so an unset flag is left off the capabilities request on its own. This removes the local omission we added as a temporary bridge — the three-state behaviour (true, false, or left off) is unchanged. Bumps the SDK requirement to ^11.0.0-beta.30.

Resolves INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…he cart

adds a test proving fromCart(cart with a company) exposes isBusiness on the config the checkout widget reads.

Resolves INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FreekVR
FreekVR force-pushed the fix/correctly-get-capabilities-for-b2b-and-b2c branch from 837c5a2 to 0a88a74 Compare July 21, 2026 08:04

@NabDevs NabDevs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, 1 potential issue that needs to be checked I think.

Comment thread src/Base/Model/Address.php
@github-project-automation github-project-automation Bot moved this from Todo to Needs work in PDK Jul 23, 2026
@myparcel-bot myparcel-bot Bot added the changes requested (Auto) label Jul 23, 2026
@FreekVR
FreekVR requested a review from NabDevs July 23, 2026 07:55
@myparcel-bot myparcel-bot Bot removed the changes requested (Auto) label Jul 23, 2026
@github-project-automation github-project-automation Bot moved this from Needs work to Testing in PDK Jul 23, 2026
@myparcel-bot myparcel-bot Bot added the approved (Auto) label Jul 23, 2026
myparcel-bot Bot pushed a commit to myparcelnl/js-pdk that referenced this pull request Jul 29, 2026
the admin now tells the capabilities request whether an order is for a business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the recipient's company name, and passes it along on both capabilities requests. Only that flag travels — never the company name or other personal data — and it's left off when it isn't set.

This is the admin side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/prestashop that referenced this pull request Jul 30, 2026
the checkout now tells the capabilities check whether an order is for a business or a consumer, so each cart sees the carriers and options that apply to it.

The flag comes from whether the delivery address has a company name. The cart repository passes the company to the PDK, which turns it into an isBusiness flag and drops the name (so no personal data is stored), and the carrier-list hook derives the same flag for its own capabilities request. Only the true/false flag is sent, never the company name.

Depends on myparcelnl/pdk#504 — needs a PDK release with the isBusiness flag before this can merge; the tests here rely on it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/prestashop that referenced this pull request Jul 30, 2026
the checkout now tells the capabilities check whether an order is for a business or a consumer, so each cart sees the carriers and options that apply to it.

The flag comes from whether the delivery address has a company name. The cart repository passes the company to the PDK, which turns it into an isBusiness flag and drops the name (so no personal data is stored), and the carrier-list hook derives the same flag for its own capabilities request. Only the true/false flag is sent, never the company name.

Depends on myparcelnl/pdk#504 — needs a PDK release with the isBusiness flag before this can merge; the tests here rely on it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/prestashop that referenced this pull request Aug 4, 2026
the checkout now tells the capabilities check whether an order is for a business or a consumer, so each cart sees the carriers and options that apply to it.

The flag comes from whether the delivery address has a company name. The cart repository passes the company to the PDK, which turns it into an isBusiness flag and drops the name (so no personal data is stored), and the carrier-list hook derives the same flag for its own capabilities request. Only the true/false flag is sent, never the company name.

Depends on myparcelnl/pdk#504 — needs a PDK release with the isBusiness flag before this can merge; the tests here rely on it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FreekVR
FreekVR added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 2bc58a5 Aug 5, 2026
17 checks passed
@FreekVR
FreekVR deleted the fix/correctly-get-capabilities-for-b2b-and-b2c branch August 5, 2026 08:50
@github-project-automation github-project-automation Bot moved this from Testing to Done in PDK Aug 5, 2026
myparcel-bot Bot added a commit that referenced this pull request Aug 5, 2026
## [4.5.0](v4.4.2...v4.5.0) (2026-08-05)

### ✨ New Features

* correct B2B/B2C capabilities via an address-based isBusiness flag ([#504](#504)) ([2bc58a5](2bc58a5)), closes [myparcelnl/core-api#4658](https://github.com/myparcelnl/core-api/issues/4658) [sdk#631](myparcelnl/sdk#631)
@myparcel-bot

myparcel-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 4.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@myparcel-bot myparcel-bot Bot added the released label Aug 5, 2026
FreekVR added a commit to myparcelnl/js-pdk that referenced this pull request Aug 5, 2026
#359)

the admin now tells the capabilities request whether an order is for a
business or a consumer, so it gets back the right options.

It reads a true/false flag (isBusiness) that the PDK works out from the
recipient's company name, and passes it along on both capabilities
requests. Only that flag travels — never the company name or other
personal data — and it's left off when it isn't set. This is the admin
side of the PDK change in myparcelnl/pdk#504.

Fixes INT-1690
Depends on myparcelnl/pdk#504

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
myparcel-bot Bot pushed a commit to myparcelnl/woocommerce that referenced this pull request Aug 5, 2026
…merce cart

adds a test proving a cart's company name reaches the PDK as the isBusiness flag — and that the company itself is not stored on the cart — plus a mock update to match the PDK's new getPackageTypeWeights signature.

WooCommerce needs no production change: its address adapter already sends the company, and the PDK turns it into the flag. The test guards that boundary so it can't silently break.

Depends on myparcelnl/pdk#504 — the assertions rely on the PDK isBusiness flag, so this can merge once a PDK release ships it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FreekVR added a commit to myparcelnl/woocommerce that referenced this pull request Aug 5, 2026
…merce cart

adds a test proving a cart's company name reaches the PDK as the isBusiness flag — and that the company itself is not stored on the cart — plus a mock update to match the PDK's new getPackageTypeWeights signature.

WooCommerce needs no production change: its address adapter already sends the company, and the PDK turns it into the flag. The test guards that boundary so it can't silently break.

Depends on myparcelnl/pdk#504 — the assertions rely on the PDK isBusiness flag, so this can merge once a PDK release ships it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
FreekVR added a commit to myparcelnl/woocommerce that referenced this pull request Aug 5, 2026
…umer orders (#1675)

* test: cover the business/consumer flag reaching the PDK from a WooCommerce cart

adds a test proving a cart's company name reaches the PDK as the isBusiness flag — and that the company itself is not stored on the cart — plus a mock update to match the PDK's new getPackageTypeWeights signature.

WooCommerce needs no production change: its address adapter already sends the company, and the PDK turns it into the flag. The test guards that boundary so it can't silently break.

Depends on myparcelnl/pdk#504 — the assertions rely on the PDK isBusiness flag, so this can merge once a PDK release ships it.

Fixes INT-1690

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* build(deps): bump pdk to 4.5.0 and admin packages to 2.1.0

Points the plugin at the releases that carry the business/consumer flag.

The PHP tests assert an isBusiness flag on order addresses, which ships in
PDK 4.5.0. The admin needs pdk-admin 2.1.0 so it actually sends that flag
when it loads shipment options. Deduped the myparcel packages afterwards so
pdk-common stays a single copy instead of ending up at both 2.0.0 and 2.1.0.

Fixes INT-1690

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants