Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vladolaru committed Sep 16, 2024
1 parent 923a213 commit 024aff7
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions client/onboarding/kyc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,26 @@ import { OnboardingContextProvider } from 'onboarding/context';
import EmbeddedKyc from 'onboarding/steps/embedded-kyc';
import strings from 'onboarding/strings';
import { getConnectUrl } from 'utils';
import { trackKycExit } from 'wcpay/onboarding/tracking';

const OnboardingKycPage: React.FC = () => {
const { detailsSubmitted: detailsSubmitted } = wcpaySettings.accountStatus;
const urlParams = new URLSearchParams( window.location.search );
const collectPayoutRequirements = !! urlParams.get(
'collect_payout_requirements'
);

const handleExit = () => {
const source =
urlParams.get( 'source' )?.replace( /[^\w-]+/g, '' ) || 'unknown';
trackKycExit();

if ( ! detailsSubmitted ) {
window.location.href = getConnectUrl(
{
source: source,
},
'WCPAY_ONBOARDING_KYC'
);
} else {
window.location.href = getConnectUrl(
{
source: source,
},
'WCPAY_ONBOARDING_KYC'
);
}
// Let the connect logic determine where the merchant should end up.
window.location.href = getConnectUrl(
{
source:
urlParams.get( 'source' )?.replace( /[^\w-]+/g, '' ) ||
'unknown',
},
'WCPAY_ONBOARDING_KYC'
);
};

useEffect( () => {
Expand Down

0 comments on commit 024aff7

Please sign in to comment.