diff --git a/includes/class-wc-payments-account.php b/includes/class-wc-payments-account.php index 6d47558b815..fa7c22b75be 100644 --- a/includes/class-wc-payments-account.php +++ b/includes/class-wc-payments-account.php @@ -2042,9 +2042,7 @@ private function init_stripe_onboarding( string $setup_mode, string $wcpay_conne } // When the new account is created, if we have test drive settings, save them to the new account. - if ( get_transient( self::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) ) { - $this->onboarding_service->save_test_drive_settings_to_new_account(); - } + $this->onboarding_service->maybe_save_test_drive_settings_to_new_account(); // We have an account that needs to be verified (has a URL to redirect the merchant to). // Store the relevant onboarding data. diff --git a/includes/class-wc-payments-onboarding-service.php b/includes/class-wc-payments-onboarding-service.php index 48737c63d41..0fb9a03cd9a 100644 --- a/includes/class-wc-payments-onboarding-service.php +++ b/includes/class-wc-payments-onboarding-service.php @@ -227,9 +227,7 @@ public function create_embedded_kyc_session( array $self_assessment_data, bool $ $this->set_embedded_kyc_in_progress(); // When the new account is created, if we have test drive settings, save them to the new account. - if ( get_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) ) { - $this->save_test_drive_settings_to_new_account(); - } + $this->maybe_save_test_drive_settings_to_new_account(); // Remember if we should enable WooPay by default. set_transient( @@ -913,7 +911,7 @@ public static function get_source( ?string $referer = null, ?array $get_params = * * @return void */ - public function save_test_drive_settings_to_new_account() { + public function maybe_save_test_drive_settings_to_new_account() { if ( ! get_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) ) { return; }