Skip to content

Commit

Permalink
change constant name
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Paun committed Dec 13, 2024
1 parent 420fd4f commit ec8f3ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions includes/class-wc-payments-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WC_Payments_Account implements MultiCurrencyAccountInterface {
const ONBOARDING_STARTED_TRANSIENT = 'wcpay_on_boarding_started';
const ONBOARDING_STATE_TRANSIENT = 'wcpay_stripe_onboarding_state';
const WOOPAY_ENABLED_BY_DEFAULT_TRANSIENT = 'woopay_enabled_by_default';
const WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT = 'test_drive_account_settings_for_live_account';
const ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT = 'test_drive_account_settings_for_live_account';
const EMBEDDED_KYC_IN_PROGRESS_OPTION = 'wcpay_onboarding_embedded_kyc_in_progress';
const ERROR_MESSAGE_TRANSIENT = 'wcpay_error_message';
const INSTANT_DEPOSITS_REMINDER_ACTION = 'wcpay_instant_deposit_reminder';
Expand Down Expand Up @@ -1318,7 +1318,7 @@ public function maybe_handle_onboarding() {
}

$this->cleanup_on_account_reset();
delete_transient( self::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT );
delete_transient( self::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT );

// When we reset the account and want to go back to the settings page - redirect immediately!
if ( $redirect_to_settings_page ) {
Expand Down Expand Up @@ -2620,7 +2620,7 @@ private function save_test_drive_settings(): void {
// We don't passing the data around, as the merchant might cancel and start
// the onboarding from scratch. In this case, we won't have the test drive
// account anymore to collect the settings.
set_transient( self::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT, $test_drive_account_data, HOUR_IN_SECONDS );
set_transient( self::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT, $test_drive_account_data, HOUR_IN_SECONDS );
}
}
}
8 changes: 4 additions & 4 deletions includes/class-wc-payments-onboarding-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,14 @@ public static function get_source( ?string $referer = null, ?array $get_params =
*/
public function maybe_add_test_drive_settings_to_new_account_request( array $args ): array {
if (
get_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) &&
is_array( get_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) )
get_transient( WC_Payments_Account::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) &&
is_array( get_transient( WC_Payments_Account::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT ) )
) {
$args['account_data'] = array_merge(
$args['account_data'],
get_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT )
get_transient( WC_Payments_Account::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT )
);
delete_transient( WC_Payments_Account::WOOPAY_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT );
delete_transient( WC_Payments_Account::ONBOARDING_TEST_DRIVE_SETTINGS_FOR_LIVE_ACCOUNT );
}

return $args;
Expand Down

0 comments on commit ec8f3ba

Please sign in to comment.