Skip to content

Commit

Permalink
[PS-768] Fix Bold payments for guest customers (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoldCole authored Feb 6, 2024
1 parent ccc5ee9 commit 5ee65fd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Checkout/Service/Extractor/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ private static function extractQuote(Mage_Sales_Model_Quote $quote)
private static function extractCustomer(Mage_Sales_Model_Quote $quote)
{
$customer = $quote->getCustomer();
if ($quote->getCustomerIsGuest()) {
if ($quote->getCustomerIsGuest() || $customer->getId() == null) {
return [
'email' => $customer->getEmail(),
'firstname' => $customer->getFirstname(),
'lastname' => $customer->getLastname(),
'email' => $customer->getEmail()
?: $quote->getBillingAddress()->getEmail(),
'firstname' => $customer->getFirstname()
?: $quote->getBillingAddress()->getFirstname(),
'lastname' => $customer->getLastname()
?: $quote->getBillingAddress()->getLastname(),
];
}

return current(Bold_Checkout_Service_Extractor_Customer::extract([$customer]));
}
}

0 comments on commit 5ee65fd

Please sign in to comment.