mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +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 );
|
||||
|
||||
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->persist();
|
||||
}
|
||||
|
@ -186,7 +186,10 @@ class WCGatewayModule implements ModuleInterface {
|
|||
add_action(
|
||||
'init',
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue