Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 27x 27x 8x 8x 8x 8x 8x | import {
ACQUIRER_PATHS,
ENTERPRISE_PATHS,
MERCHANT_PATHS,
} from "@routes/paths";
export type RedirectURLKeys =
| "settings"
| "merchants"
| "manage-money"
| "transfers"
| "verify_identity"
| "providers"
| "manage_team"
| "disputes"
| "transactions";
export type CurrentPortalKey = "merchant" | "provider" | "acquirer";
type TValues = Record<CurrentPortalKey, string>;
export const redirectPageUrls: Record<RedirectURLKeys, TValues> = {
settings: {
merchant: `settings/${MERCHANT_PATHS.BUSINESS}`,
provider: `settings/${ENTERPRISE_PATHS.BUSINESS_DETAILS}`,
acquirer: `settings/${ACQUIRER_PATHS.BUSINESS_DETAILS}`,
},
merchants: {
merchant: "",
provider: ENTERPRISE_PATHS.MERCHANTS,
acquirer: ACQUIRER_PATHS.MERCHANTS,
},
providers: {
merchant: "",
provider: "",
acquirer: ACQUIRER_PATHS.PROVIDERS,
},
"manage-money": {
merchant: MERCHANT_PATHS.MANAGE_MONEY,
provider: ENTERPRISE_PATHS.MANAGE_MONEY,
acquirer: ACQUIRER_PATHS.MANAGE_MONEY,
},
transfers: {
merchant: MERCHANT_PATHS.MANAGE_MONEY,
provider: ENTERPRISE_PATHS.TRANSACTIONS, // we no longer have transfer page
acquirer: ACQUIRER_PATHS.TRANSACTIONS, // we no longer have transfer page
},
verify_identity: {
merchant: MERCHANT_PATHS.WELCOME,
provider: ENTERPRISE_PATHS.WELCOME,
acquirer: "",
},
manage_team: {
merchant: `settings/${MERCHANT_PATHS.MANAGE_TEAM}`,
provider: `settings/${ENTERPRISE_PATHS.MANAGE_TEAM}`,
acquirer: `settings/${ACQUIRER_PATHS.MANAGE_TEAM}`,
},
disputes: {
acquirer: ACQUIRER_PATHS.DISPUTES, // For now disputes will be only available to acquirer
provider: "",
merchant: "",
},
transactions: {
merchant: MERCHANT_PATHS.MANAGE_MONEY ?? "",
provider: ENTERPRISE_PATHS.TRANSACTIONS ?? "",
acquirer: ACQUIRER_PATHS.TRANSACTIONS ?? "",
},
};
export const getIdFromTString = (text: string) => {
const id = text.match(/\d+/);
Iif (!id?.[0]) return null;
const merchantId = parseInt(id[0]);
Iif (Number.isNaN(merchantId)) return null;
return merchantId;
};
|