llp пре 2 дана
родитељ
комит
e145559fac

+ 7 - 4
packages/Longyi/Pay/Afterpay/src/Payment/Afterpay.php

@@ -209,12 +209,15 @@ class Afterpay extends Payment
             return false;
         }
         $cart = Cart::getCart();
-        if (! $cart || ! $cart->billing_address) {
+        if (! $cart) {
             return false;
         }
-        $billingCountry = $cart->billing_address->country;
-        $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
-        return in_array($billingCountry, $allowedCountries);
+        if ($cart->billing_address) {
+            $billingCountry = $cart->billing_address->country;
+            $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
+            return in_array($billingCountry, $allowedCountries);
+        }
+        return true;
     }
 
     public function formatCurrencyValue($number): float

+ 7 - 4
packages/Longyi/Pay/Airwallex/src/Payment/Airwallex.php

@@ -237,11 +237,14 @@ class Airwallex extends Payment
             return false;
         }
         $cart = Cart::getCart();
-        if (! $cart || ! $cart->billing_address) {
+        if (! $cart) {
             return false;
         }
-        $billingCountry = $cart->billing_address->country;
-        $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
-        return in_array($billingCountry, $allowedCountries);
+        if ($cart->billing_address) {
+            $billingCountry = $cart->billing_address->country;
+            $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
+            return in_array($billingCountry, $allowedCountries);
+        }
+        return true;
     }
 }

+ 7 - 4
packages/Longyi/Pay/AwxAfterpay/src/Payment/AwxAfterpay.php

@@ -289,11 +289,14 @@ class AwxAfterpay extends Payment
             return false;
         }
         $cart = Cart::getCart();
-        if (! $cart || ! $cart->billing_address) {
+        if (! $cart) {
             return false;
         }
-        $billingCountry = $cart->billing_address->country;
-        $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
-        return in_array($billingCountry, $allowedCountries);
+        if ($cart->billing_address) {
+            $billingCountry = $cart->billing_address->country;
+            $allowedCountries = ['AU', 'CA', 'NZ', 'GB', 'US'];
+            return in_array($billingCountry, $allowedCountries);
+        }
+        return true;
     }
 }

+ 9 - 6
packages/Longyi/Pay/AwxKlarna/src/Payment/AwxKlarna.php

@@ -297,14 +297,17 @@ class AwxKlarna extends Payment
             return false;
         }
         $cart = Cart::getCart();
-        if (! $cart || ! $cart->billing_address) {
+        if (! $cart) {
             return false;
         }
-        $billingCountry = $cart->billing_address->country;
-        $allowedCountries = ['AU', 'AT', 'BE', 'CA', 'CZ', 'DK', 'FI', 'FR', 'DE', 'GR', 'IE',
-            'IT', 'NL', 'NO', 'PL', 'PT', 'ES', 'SE', 'CH', 'GB', 'US'
-        ];
-        return in_array($billingCountry, $allowedCountries);
+        if ($cart->billing_address) {
+            $billingCountry = $cart->billing_address->country;
+            $allowedCountries = ['AU', 'AT', 'BE', 'CA', 'CZ', 'DK', 'FI', 'FR', 'DE', 'GR', 'IE',
+                'IT', 'NL', 'NO', 'PL', 'PT', 'ES', 'SE', 'CH', 'GB', 'US'
+            ];
+            return in_array($billingCountry, $allowedCountries);
+        }
+        return true;
     }
 
     public function getDescription()