Skip to content

Commit 136e02e

Browse files
author
Oleksandr Dubovyk
committed
MC-18365: PayPal Express Address Fields - Concatenating First/Last Name
- fixed static
1 parent cdc9ed0 commit 136e02e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Paypal/Model/Api/Nvp.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,11 +1519,10 @@ protected function _applyStreetAndRegionWorkarounds(DataObject $address)
15191519
)->setPageSize(
15201520
1
15211521
);
1522-
foreach ($regions as $region) {
1523-
$address->setRegionId($region->getId());
1524-
$address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
1525-
break;
1526-
}
1522+
$regionItems = $regions->getItems();
1523+
$region = array_shift($regionItems);
1524+
$address->setRegionId($region->getId());
1525+
$address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
15271526
}
15281527
}
15291528

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,14 @@ public function __construct(
357357
if (isset($params['config']) && $params['config'] instanceof PaypalConfig) {
358358
$this->_config = $params['config'];
359359
} else {
360+
// phpcs:ignore Magento2.Exceptions.DirectThrow
360361
throw new \Exception('Config instance is required.');
361362
}
362363

363364
if (isset($params['quote']) && $params['quote'] instanceof \Magento\Quote\Model\Quote) {
364365
$this->_quote = $params['quote'];
365366
} else {
367+
// phpcs:ignore Magento2.Exceptions.DirectThrow
366368
throw new \Exception('Quote instance is required.');
367369
}
368370
}

0 commit comments

Comments
 (0)