mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Ensure 3ds contingency uses SCA_ALWAYS
instead of 3D_SECURE
This commit is contained in:
parent
e080189399
commit
3b0a057b31
3 changed files with 24 additions and 1 deletions
|
@ -627,6 +627,10 @@ class SmartButton implements SmartButtonInterface {
|
||||||
if ( $this->settings->has( '3d_secure_contingency' ) ) {
|
if ( $this->settings->has( '3d_secure_contingency' ) ) {
|
||||||
$value = $this->settings->get( '3d_secure_contingency' );
|
$value = $this->settings->get( '3d_secure_contingency' );
|
||||||
if ( $value ) {
|
if ( $value ) {
|
||||||
|
if ( '3D_SECURE' === $value ) {
|
||||||
|
$value = 'SCA_ALWAYS';
|
||||||
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,9 @@ use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||||
use WooCommerce\PayPalCommerce\Webhooks\WebhookRegistrar;
|
use WooCommerce\PayPalCommerce\Webhooks\WebhookRegistrar;
|
||||||
|
use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SettingsListener
|
* Class SettingsListener
|
||||||
|
@ -208,6 +208,24 @@ class SettingsListener {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure 3DS contingency use `SCA_ALWAYS` instead of `3D_SECURE`.
|
||||||
|
*
|
||||||
|
* @throws NotFoundException When a setting was not found.
|
||||||
|
*/
|
||||||
|
public function listen_for_3d_secure_contingency() {
|
||||||
|
if ( ! $this->is_valid_site_request() || $this->settings->get( '3d_secure_contingency' ) !== '3D_SECURE' ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->settings->set( '3d_secure_contingency', 'SCA_ALWAYS' );
|
||||||
|
$this->settings->persist();
|
||||||
|
|
||||||
|
$redirect_url = admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' );
|
||||||
|
wp_safe_redirect( $redirect_url, 302 );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listens to the request.
|
* Listens to the request.
|
||||||
*
|
*
|
||||||
|
|
|
@ -183,6 +183,7 @@ class WCGatewayModule implements ModuleInterface {
|
||||||
*/
|
*/
|
||||||
$listener->listen_for_merchant_id();
|
$listener->listen_for_merchant_id();
|
||||||
$listener->listen_for_vaulting_enabled();
|
$listener->listen_for_vaulting_enabled();
|
||||||
|
$listener->listen_for_3d_secure_contingency();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue