Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
},
"Fix for multi-site configuration issue": {
"2.2.4": "MAGETWO-92926__fix_for_multi-site_configuration_issue__2.2.4.patch"
},
"Fix PayPal issue with region": {
"2.3.4": "MC-31387__fix_paypal_issue_with_region__2.3.4.patch"
Copy link
Contributor

@oshmyheliuk oshmyheliuk Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be this fix present in 2.3.4 patch versions?
If not you need to change constraint to ">=2.3.4 < 2.3.5"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oshmyheliuk yes, fix will be present in patch versions starting from 2.3.4-p1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oshmyheliuk, the fix will be ported into the 2.3.4 security patch.
cc: @RyanZolper, @smiverma

}
},
"monolog/monolog": {
Expand Down
67 changes: 67 additions & 0 deletions patches/MC-31387__fix_paypal_issue_with_region__2.3.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff -Nuar a/vendor/magento/module-paypal/Model/Api/Nvp.php b/vendor/magento/module-paypal/Model/Api/Nvp.php
--- a/vendor/magento/module-paypal/Model/Api/Nvp.php
+++ b/vendor/magento/module-paypal/Model/Api/Nvp.php
@@ -1512,17 +1512,17 @@
}
// attempt to fetch region_id from directory
if ($address->getCountryId() && $address->getRegion()) {
- $regions = $this->_countryFactory->create()->loadByCode(
- $address->getCountryId()
- )->getRegionCollection()->addRegionCodeOrNameFilter(
- $address->getRegion()
- )->setPageSize(
- 1
- );
+ $regions = $this->_countryFactory->create()
+ ->getRegionCollection()
+ ->addCountryFilter($address->getCountryId())
+ ->addRegionCodeOrNameFilter($address->getRegion())
+ ->setPageSize(1);
$regionItems = $regions->getItems();
- $region = array_shift($regionItems);
- $address->setRegionId($region->getId());
- $address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
+ if (count($regionItems)) {
+ $region = array_shift($regionItems);
+ $address->setRegionId($region->getId());
+ $address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
+ }
}
}

@@ -1624,7 +1624,7 @@
case 'year':
return 'Year';
default:
- break;
+ return '';
}
}

@@ -1653,7 +1653,7 @@
case 'active':
return 'Active';
default:
- break;
+ return '';
}
}

@@ -1694,7 +1694,7 @@
case 'Voided':
return \Magento\Paypal\Model\Info::PAYMENTSTATUS_VOIDED;
default:
- break;
+ return null;
}
}

@@ -1712,7 +1712,7 @@
case \Magento\Paypal\Model\Pro::PAYMENT_REVIEW_DENY:
return 'Deny';
default:
- break;
+ return null;
}
}