mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #647 from woocommerce/pcp-478-fix-vaulting-redirect
Remove redirect after vaulting settings check
This commit is contained in:
commit
4b4be4ff1b
1 changed files with 1 additions and 14 deletions
|
@ -167,7 +167,7 @@ class SettingsListener {
|
|||
* Prevent enabling both Pay Later messaging and PayPal vaulting
|
||||
*/
|
||||
public function listen_for_vaulting_enabled() {
|
||||
if ( ! $this->is_valid_site_request() ) {
|
||||
if ( ! $this->is_valid_site_request() || State::STATE_ONBOARDED !== $this->state->current_state() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -208,10 +208,6 @@ class SettingsListener {
|
|||
$this->settings->set( 'message_product_enabled', false );
|
||||
$this->settings->set( 'message_cart_enabled', false );
|
||||
$this->settings->persist();
|
||||
|
||||
$redirect_url = admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' );
|
||||
wp_safe_redirect( $redirect_url, 302 );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -441,19 +437,10 @@ class SettingsListener {
|
|||
*/
|
||||
private function is_valid_site_request() : bool {
|
||||
|
||||
/**
|
||||
* No nonce needed at this point.
|
||||
*
|
||||
* phpcs:disable WordPress.Security.NonceVerification.Missing
|
||||
* phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
*/
|
||||
if ( empty( $this->page_id ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
if ( ! current_user_can( 'manage_woocommerce' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue