mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Only init pui if gateway is enabled
This commit is contained in:
parent
d99fdb15d3
commit
72efcbb71d
1 changed files with 5 additions and 2 deletions
|
@ -173,7 +173,7 @@ class WCGatewayModule implements ModuleInterface {
|
||||||
assert( $settings instanceof Settings );
|
assert( $settings instanceof Settings );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ( $settings->get( '3d_secure_contingency' ) === '3D_SECURE' ) {
|
if ( $settings->has( '3d_secure_contingency' ) && $settings->get( '3d_secure_contingency' ) === '3D_SECURE' ) {
|
||||||
$settings->set( '3d_secure_contingency', 'SCA_ALWAYS' );
|
$settings->set( '3d_secure_contingency', 'SCA_ALWAYS' );
|
||||||
$settings->persist();
|
$settings->persist();
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,10 @@ class WCGatewayModule implements ModuleInterface {
|
||||||
add_action(
|
add_action(
|
||||||
'init',
|
'init',
|
||||||
function () use ( $c ) {
|
function () use ( $c ) {
|
||||||
if ( 'DE' === $c->get( 'api.shop.country' ) ) {
|
$gateway_settings = get_option( 'woocommerce_ppcp-pay-upon-invoice-gateway_settings' );
|
||||||
|
$gateway_enabled = $gateway_settings['enabled'] ?? '';
|
||||||
|
|
||||||
|
if ( 'yes' === $gateway_enabled && 'DE' === $c->get( 'api.shop.country' ) ) {
|
||||||
( $c->get( 'wcgateway.pay-upon-invoice' ) )->init();
|
( $c->get( 'wcgateway.pay-upon-invoice' ) )->init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue