From 2932d6613dc7de0f3a2e298d1f96bac373f6cc08 Mon Sep 17 00:00:00 2001 From: lubega-deriv Date: Tue, 19 Mar 2024 10:38:49 +0800 Subject: [PATCH] feat: third party redirection for wallets cashier --- .../src/App/Containers/Redirect/redirect.jsx | 32 ++++++++++++++++--- packages/shared/src/utils/routes/routes.ts | 2 ++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/packages/core/src/App/Containers/Redirect/redirect.jsx b/packages/core/src/App/Containers/Redirect/redirect.jsx index ba9082511452..fdd2c54c782e 100644 --- a/packages/core/src/App/Containers/Redirect/redirect.jsx +++ b/packages/core/src/App/Containers/Redirect/redirect.jsx @@ -139,19 +139,41 @@ const Redirect = observer(() => { setResetTradingPasswordModalOpen(true); break; } + case 'payment_deposit': { + if (is_next_wallet) { + history.push(routes.wallets_deposit); + } else { + history.push(routes.cashier_deposit); + } + redirected_to_route = true; + break; + } case 'payment_withdraw': { if (is_next_wallet) { - // passes verification_code through query param as we do not want to use localstorage/session storage - // though can't use "verification_code" as name param - // as there is general logic within client-store - // which removes anything which resembles code=XYZ - history.push(`${routes.wallets_withdrawal}?verification=${verification_code?.payment_withdraw}`); + if (verification_code?.payment_withdraw) { + // passes verification_code through query param as we do not want to use localstorage/session storage + // though can't use "verification_code" as name param + // as there is general logic within client-store + // which removes anything which resembles code=XYZ + history.push(`${routes.wallets_withdrawal}?verification=${verification_code?.payment_withdraw}`); + } else { + history.push(routes.wallets_withdrawal); + } } else { history.push(routes.cashier_withdrawal); } redirected_to_route = true; break; } + case 'payment_transfer': { + if (is_next_wallet) { + history.push(routes.wallets_transfer); + } else { + history.push(routes.cashier_acc_transfer); + } + redirected_to_route = true; + break; + } case 'payment_agent_withdraw': { history.push(routes.cashier_pa); redirected_to_route = true; diff --git a/packages/shared/src/utils/routes/routes.ts b/packages/shared/src/utils/routes/routes.ts index 9c9a132661e1..d9d4574dee24 100644 --- a/packages/shared/src/utils/routes/routes.ts +++ b/packages/shared/src/utils/routes/routes.ts @@ -79,7 +79,9 @@ export const routes = { // Wallets wallets: '/wallets', wallets_cashier: '/wallets/cashier', + wallets_deposit: '/wallets/cashier/deposit', wallets_withdrawal: '/wallets/cashier/withdraw', + wallets_transfer: 'wallets/cashier/transfer', wallets_compare_accounts: '/wallets/compare-accounts', // Traders Hub