Skip to content

Commit

Permalink
feat: third party redirection for wallets cashier
Browse files Browse the repository at this point in the history
  • Loading branch information
lubega-deriv committed Mar 19, 2024
1 parent 653541d commit 2932d66
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
32 changes: 27 additions & 5 deletions packages/core/src/App/Containers/Redirect/redirect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/utils/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2932d66

Please sign in to comment.