Rely on the shippingOrderManager to pack the order in PayPal Checkout

Created on 14 July 2025, about 1 month ago

Problem/Motivation

Currently, we have the following code for packing the order into shipments:

if (!$shipments) {
        /** @var \Drupal\commerce_shipping\PackerManagerInterface $packer_manager */
        // @phpstan-ignore-next-line
        $packer_manager = \Drupal::service('commerce_shipping.packer_manager');
        [$shipments] = $packer_manager->packToShipments($order, $this->buildCustomerProfile($order), $shipments);
      }

This should call the ShippingOrderManager instead which should be conditionally injected.

Also, the buildCustomerProfile() shouldn't create a profile that has the UID set to the order customer ID as the profile belongs to the order, not the customer.

🐛 Bug report
Status

Active

Version

1.0

Component

PayPal Checkout

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024