diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php b/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php index 7e3927cf4..f0d077a37 100644 --- a/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php +++ b/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php @@ -108,6 +108,12 @@ class SettingsListener { $this->settings->set( 'merchant_id', $merchant_id ); $this->settings->set( 'merchant_email', $merchant_email ); + if ( ! $this->settings->has( 'client_id' ) || ! $this->settings->get( 'client_id' ) ) { + $redirect_url = admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway&ppcp-onboarding-error=1' ); + wp_safe_redirect( $redirect_url, 302 ); + exit; + } + $is_sandbox = $this->settings->has( 'sandbox_on' ) && $this->settings->get( 'sandbox_on' ); if ( $is_sandbox ) { $this->settings->set( 'merchant_id_sandbox', $merchant_id ); diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php b/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php index 6bb60a52b..1a7da4754 100644 --- a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php +++ b/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php @@ -224,6 +224,21 @@ class SettingsRenderer { */ public function render() { + //phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( isset( $_GET['ppcp-onboarding-error'] ) ) : + ?> +
+

+ +

+
+