-
Notifications
You must be signed in to change notification settings - Fork 0
/
magento-paypal-braintree-config-array.patch
32 lines (32 loc) · 1.47 KB
/
magento-paypal-braintree-config-array.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
Index: vendor/paypal/module-braintree-core/Model/Adminhtml/System/Config/CountryCreditCard.php
<+>UTF-8
===================================================================
--- a/vendor/paypal/module-braintree-core/Model/Adminhtml/System/Config/CountryCreditCard.php
+++ b/vendor/paypal/module-braintree-core/Model/Adminhtml/System/Config/CountryCreditCard.php
@@ -69,15 +69,17 @@
{
$value = $this->getValue();
$result = [];
- foreach ($value as $data) {
- if (empty($data['country_id']) || empty($data['cc_types'])) {
- continue;
- }
- $country = $data['country_id'];
- if (array_key_exists($country, $result)) {
- $result[$country] = $this->appendUniqueCountries($result[$country], $data['cc_types']);
- } else {
- $result[$country] = $data['cc_types'];
+ if (is_array($value)) {
+ foreach ($value as $data) {
+ if (empty($data['country_id']) || empty($data['cc_types'])) {
+ continue;
+ }
+ $country = $data['country_id'];
+ if (array_key_exists($country, $result)) {
+ $result[$country] = $this->appendUniqueCountries($result[$country], $data['cc_types']);
+ } else {
+ $result[$country] = $data['cc_types'];
+ }
}
}
$this->setValue($this->serializer->serialize($result));