-
Notifications
You must be signed in to change notification settings - Fork 2
/
PayPal_Express_Checkout_issue_fix_2.3.4_composer-2020-02-13-12-34-09.patch
71 lines (66 loc) · 2.36 KB
/
PayPal_Express_Checkout_issue_fix_2.3.4_composer-2020-02-13-12-34-09.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Index: ../vendor/magento/module-paypal/Model/Api/Nvp.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- a/vendor/magento/module-paypal/Model/Api/Nvp.php (revision 0595b0dbe57711bccb5cdb049bdae9ac8ba8b0cc)
+++ b/vendor/magento/module-paypal/Model/Api/Nvp.php (date 1581448283375)
@@ -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;
}
}