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 64b9c2e5 authored by attilak's avatar attilak

using !empty instead of double check with isset

trim address before parsing
parent 866e6cef
...@@ -217,11 +217,11 @@ class Redirect extends \Magento\Payment\Block\Form ...@@ -217,11 +217,11 @@ class Redirect extends \Magento\Payment\Block\Form
if ($this->_adyenHelper->isSeparateHouseNumberRequired($billingAddress->getCountryId())) { if ($this->_adyenHelper->isSeparateHouseNumberRequired($billingAddress->getCountryId())) {
$street = $this->_adyenHelper->getStreet($billingAddress); $street = $this->_adyenHelper->getStreet($billingAddress);
if (isset($street['name']) && $street['name'] != "") { if (!empty($street['name'])) {
$formFields['billingAddress.street'] = $street['name']; $formFields['billingAddress.street'] = $street['name'];
} }
if (isset($street['house_number']) && $street['house_number'] != "") { if (!empty($street['house_number'])) {
$formFields['billingAddress.houseNumberOrName'] = $street['house_number']; $formFields['billingAddress.houseNumberOrName'] = $street['house_number'];
} else { } else {
$formFields['billingAddress.houseNumberOrName'] = "NA"; $formFields['billingAddress.houseNumberOrName'] = "NA";
......
...@@ -382,6 +382,9 @@ class Data extends AbstractHelper ...@@ -382,6 +382,9 @@ class Data extends AbstractHelper
if (count($street) != 1) { if (count($street) != 1) {
return $street; return $street;
} }
$street['0'] = trim($street['0']);
preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE); preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE);
if (!empty($houseNumber['0'])) { if (!empty($houseNumber['0'])) {
$_houseNumber = trim($houseNumber['0']['0']); $_houseNumber = trim($houseNumber['0']['0']);
......
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