mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
register dcc gateway only when dcc applies
This commit is contained in:
parent
0d02c1f421
commit
85efab5935
1 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,7 @@ namespace Inpsyde\PayPalCommerce\WcGateway;
|
|||
use Dhii\Container\ServiceProvider;
|
||||
use Dhii\Modular\Module\ModuleInterface;
|
||||
use Inpsyde\PayPalCommerce\AdminNotices\Repository\Repository;
|
||||
use Inpsyde\PayPalCommerce\ApiClient\Helper\DccApplies;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Admin\OrderDetail;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Admin\OrderTablePaymentStatusColumn;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Admin\PaymentStatusOrderDetail;
|
||||
|
@ -99,7 +100,13 @@ class WcGatewayModule implements ModuleInterface
|
|||
'woocommerce_payment_gateways',
|
||||
static function ($methods) use ($container): array {
|
||||
$methods[] = $container->get('wcgateway.paypal-gateway');
|
||||
$methods[] = $container->get('wcgateway.credit-card-gateway');
|
||||
$dccApplies = $container->get('api.helpers.dccapplies');
|
||||
/**
|
||||
* @var DccApplies $dccApplies
|
||||
*/
|
||||
if ($dccApplies->forCountryCurrency()) {
|
||||
$methods[] = $container->get('wcgateway.credit-card-gateway');
|
||||
}
|
||||
return (array)$methods;
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue