|
|
@@ -133,15 +133,13 @@ class Clearpay extends Afterpay
|
|
|
return false;
|
|
|
}
|
|
|
$info = $this->getOrder() ?: Cart::getCart();
|
|
|
- if ($info && $billingCountry = $info->billing_address->country ?? false) {
|
|
|
-// $allowedCountries = $this->getConfigData('allowed_countries');
|
|
|
-// if (empty($allowedCountries)) {
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// $allowedCountries = explode(',', $allowedCountries);
|
|
|
-// return in_array($billingCountry, $allowedCountries);
|
|
|
- $allowedCountries = ['GB'];//英国
|
|
|
- return in_array($billingCountry, $allowedCountries);
|
|
|
+ if ($info) {
|
|
|
+ $billingCountry = $info->billing_address->country ?? false;
|
|
|
+ $currency = $info->order_currency_code ?? $info->cart_currency_code ?? false;
|
|
|
+ // 仅当国家为 GB 且货币为 GBP 时才显示 Clearpay
|
|
|
+ if ($billingCountry === 'GB' && $currency === 'GBP') {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
return false;
|
|
|
}
|