diff --git a/Gateway/Request/CustomerDataBuilder.php b/Gateway/Request/CustomerDataBuilder.php index 279fe91..266eb6a 100644 --- a/Gateway/Request/CustomerDataBuilder.php +++ b/Gateway/Request/CustomerDataBuilder.php @@ -80,10 +80,14 @@ public function build(array $subject) $customerId = null; $profileId = null; + $guest = false; if ($this->session->isLoggedIn()) { $customerId = $this->session->getCustomerId(); $profileId = $this->getCimProfileId(); + } else { + $email = null; + $guest = true; } /** @@ -92,6 +96,7 @@ public function build(array $subject) $customerProfile = $this->customerProfileFactory->create(); $customerProfile->setCustomerId($customerId); $customerProfile->setEmail($email ?: $order->getOrderIncrementId() . '_' . mt_rand() . '-' . time()); + $customerProfile->setProfileType($guest ? 'guest' : 'regular'); return [ self::CUSTOMER_ID => $customerId, diff --git a/composer.json b/composer.json index 4fc4db9..dd76201 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "magento/framework": "~101.0.0", - "pmclain/authorizenet-php-sdk": "~0.1.5" + "pmclain/authorizenet-php-sdk": "~0.1.7" }, "autoload": { "files": [