We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit cab7d6f0 authored by attilak's avatar attilak

resolve code review comments

parent d91714a8
...@@ -42,18 +42,26 @@ class CustomerDataBuilder implements BuilderInterface ...@@ -42,18 +42,26 @@ class CustomerDataBuilder implements BuilderInterface
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */ /** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject); $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
$order = $paymentDataObject->getOrder(); $order = $paymentDataObject->getOrder();
$billingAddress = $order->getBillingAddress();
$customerEmail = $billingAddress->getEmail();
$customerId = $order->getCustomerId(); $customerId = $order->getCustomerId();
if ($customerId > 0) { if ($customerId > 0) {
$result['shopperReference'] = $customerId; $result['shopperReference'] = $customerId;
} }
$result['telephoneNumber'] = trim($billingAddress->getTelephone()); $billingAddress = $order->getBillingAddress();
$result['shopperEmail'] = $customerEmail;
if (!empty($billingAddress)) {
$customerEmail = $billingAddress->getEmail();
if ($customerEmail) {
$result['shopperEmail'] = $customerEmail;
}
$customerTelephone = trim($billingAddress->getTelephone());
if ($customerTelephone) {
$result['telephoneNumber'] = $customerTelephone;
}
}
return $result; return $result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment