You are here

protected function Checkout::buildCustomerProfile in Commerce PayPal 8

Builds a customer profile, assigned to the order's owner.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

Return value

\Drupal\profile\Entity\ProfileInterface The customer profile.

1 call to Checkout::buildCustomerProfile()
Checkout::updateProfile in src/Plugin/Commerce/PaymentGateway/Checkout.php
Updates the profile of the given type using the response returned by PayPal.

File

src/Plugin/Commerce/PaymentGateway/Checkout.php, line 846

Class

Checkout
Provides the PayPal Checkout payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function buildCustomerProfile(OrderInterface $order) {
  return $this->entityTypeManager
    ->getStorage('profile')
    ->create([
    'uid' => $order
      ->getCustomerId(),
    'type' => 'customer',
  ]);
}