Skip to content

Commit

Permalink
Merge pull request #32 from MoT3rror/patch-2
Browse files Browse the repository at this point in the history
Send guest profile type when using guest checkout
  • Loading branch information
pmclain committed Jan 10, 2019
2 parents 667e7a4 + 7ed4494 commit fc02039
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Gateway/Request/CustomerDataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit fc02039

Please sign in to comment.