We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 51fa3c5a authored by cyattilakiss's avatar cyattilakiss Committed by GitHub

Merge pull request #382 from Adyen/customer-data-telephone

Extend customer data with telephone number
parents 5d1d536a cab7d6f0
......@@ -42,17 +42,26 @@ class CustomerDataBuilder implements BuilderInterface
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
$order = $paymentDataObject->getOrder();
$billingAddress = $order->getBillingAddress();
$customerEmail = $billingAddress->getEmail();
$customerId = $order->getCustomerId();
if ($customerId > 0) {
$result['shopperReference'] = $customerId;
}
$result ['shopperEmail'] = $customerEmail;
$billingAddress = $order->getBillingAddress();
if (!empty($billingAddress)) {
$customerEmail = $billingAddress->getEmail();
if ($customerEmail) {
$result['shopperEmail'] = $customerEmail;
}
$customerTelephone = trim($billingAddress->getTelephone());
if ($customerTelephone) {
$result['telephoneNumber'] = $customerTelephone;
}
}
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