mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Redirect on any credentials change (including sandbox checkbox)
otherwise we may use wrong state/host e.g. for webhook subscription
This commit is contained in:
parent
4c59337247
commit
8188faeec4
2 changed files with 3 additions and 11 deletions
|
@ -322,16 +322,6 @@ class SettingsListener {
|
|||
}
|
||||
$this->settings->persist();
|
||||
|
||||
if ( $credentials_change_status ) {
|
||||
if ( in_array(
|
||||
$credentials_change_status,
|
||||
array( self::CREDENTIALS_ADDED, self::CREDENTIALS_CHANGED ),
|
||||
true
|
||||
) ) {
|
||||
$this->webhook_registrar->register();
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->cache->has( PayPalBearer::CACHE_KEY ) ) {
|
||||
$this->cache->delete( PayPalBearer::CACHE_KEY );
|
||||
}
|
||||
|
@ -345,7 +335,7 @@ class SettingsListener {
|
|||
}
|
||||
|
||||
$redirect_url = false;
|
||||
if ( self::CREDENTIALS_ADDED === $credentials_change_status ) {
|
||||
if ( self::CREDENTIALS_UNCHANGED !== $credentials_change_status ) {
|
||||
$redirect_url = $this->get_onboarding_redirect_url();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue