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 | 29x 29x 1094x 16x 1078x 1078x 5616x 1078x | import { transferStatuses } from "../constants";
export const TRANSFER_STATUSES_MANAGE_MONEY = [
"enqueued",
"approved",
"processing",
"settled",
// Returned transfers (modeled as transfer_return transactions) should be
// filterable on both the Manage Money and Transactions pages.
"returned",
];
export const TRANSFER_STATUSES_TRANSACTIONS = [
...TRANSFER_STATUSES_MANAGE_MONEY,
"canceled",
"failed",
];
export default function useGetTransferStatus({
isAcquirerProcessing,
isTransactions,
isMerchantPortal,
isTransfers,
}: {
isAcquirerProcessing: boolean;
isTransactions?: boolean;
isMerchantPortal?: boolean;
isTransfers?: boolean;
}) {
if (isTransfers) {
return {
transferStatuses,
};
}
const values = isTransactions
? TRANSFER_STATUSES_TRANSACTIONS
: TRANSFER_STATUSES_MANAGE_MONEY;
const usedStatuses = isMerchantPortal
? transferStatuses
: transferStatuses?.filter((status) => values.includes(status?.value));
return {
transferStatuses: usedStatuses,
};
}
|