mirror of
https://github.com/valitydev/dashboard.git
synced 2024-11-06 02:25:23 +00:00
remove errors translation, translation for terminal (#235)
This commit is contained in:
parent
622e3a81aa
commit
17afdd69e3
@ -1,4 +1,3 @@
|
||||
import { translate } from '@ngneat/transloco';
|
||||
import sortBy from 'lodash.sortby';
|
||||
|
||||
import { PaymentsErrorsDistributionResult } from '../../../../api-codegen/anapi/swagger-codegen';
|
||||
@ -18,7 +17,7 @@ const groupErrors = (errors: PaymentsErrorsDistributionResult[], count: number):
|
||||
.slice(count)
|
||||
.map((e) => e.percents)
|
||||
.reduce((prev, curr) => prev + curr);
|
||||
groupedErrors.push({ error: "'otherErrors'", percents: otherErrorsSummary });
|
||||
groupedErrors.push({ error: 'Other', percents: otherErrorsSummary });
|
||||
return groupedErrors;
|
||||
};
|
||||
|
||||
@ -33,13 +32,8 @@ const prepareErrors = (errors: PaymentsErrorsDistributionResult[]): PaymentsErro
|
||||
|
||||
const errorsToSeries = (errors: PaymentsErrorsDistributionResult[]): number[] => errors.map((d) => d.percents);
|
||||
|
||||
const errorsToErrorCodes = (errors: PaymentsErrorsDistributionResult[]): string[] =>
|
||||
errors.map((d) => `analytics.errorCodes.${d.error.split("'")[1] ?? 'unknownError'}`);
|
||||
|
||||
const errorsToLabels = (errors: PaymentsErrorsDistributionResult[]): string[] => {
|
||||
const errorCodes: string[] = errorsToErrorCodes(errors);
|
||||
return translate(errorCodes, null, 'payment-section|scoped');
|
||||
};
|
||||
const errorsToLabels = (errors: PaymentsErrorsDistributionResult[]): string[] =>
|
||||
errors.map((d) => d.error.split("'")[3] || d.error || 'Unknown error');
|
||||
|
||||
export const paymentsErrorsDistributionToChartData = (
|
||||
distribution: PaymentsErrorsDistributionResult[]
|
||||
|
@ -31,7 +31,8 @@
|
||||
},
|
||||
"paymentToolsList": {
|
||||
"bank_card": "Банковская карта",
|
||||
"digital_wallet": "Кошелек"
|
||||
"digital_wallet": "Кошелек",
|
||||
"payment_terminal": "Терминал"
|
||||
},
|
||||
"paymentStatuses": {
|
||||
"pending": "Запущен",
|
||||
@ -40,60 +41,6 @@
|
||||
"cancelled": "Отменен",
|
||||
"refunded": "Возвращен",
|
||||
"failed": "Неуспешен"
|
||||
},
|
||||
"errorCodes": {
|
||||
"otherErrors": "Прочие",
|
||||
"unknownError": "Неизвестная ошибка",
|
||||
"-3": "No or Invalid response received",
|
||||
"01": "Call your bank",
|
||||
"04": "Your card is restricted",
|
||||
"05": "Transaction declined",
|
||||
"07": "Your card is disabled",
|
||||
"12": "Invalid transaction",
|
||||
"14": "No such card",
|
||||
"15": "No such card/issuer",
|
||||
"41": "Lost card",
|
||||
"43": "Stolen card",
|
||||
"51": "Not sufficient funds",
|
||||
"54": "Expired card",
|
||||
"57": "Not permitted to client",
|
||||
"58": "Not permitted to merchant",
|
||||
"61": "Exceeds amount limit",
|
||||
"62": "Restricted card",
|
||||
"65": "Exceeds frequency limit",
|
||||
"75": "PIN tries exceeded",
|
||||
"77": "Wrong Reference No.",
|
||||
"88": "Cryptographic failure",
|
||||
"91": "Issuer unavailable",
|
||||
"93": "Violation of law",
|
||||
"96": "System malfunction",
|
||||
"100": "Decline (general, no comments)",
|
||||
"101": "Decline, expired card",
|
||||
"102": "Decline, suspected fraud",
|
||||
"103": "Decline, card acceptor contact acquirer",
|
||||
"104": "Decline, restricted card",
|
||||
"106": "Decline, allowable PIN tries exceeded",
|
||||
"107": "Decline, refer to card issuer",
|
||||
"108": "Decline, refer to card issuer",
|
||||
"111": "Decline, invalid card number",
|
||||
"116": "Decline, not sufficient funds",
|
||||
"119": "Decline, transaction not permitted to cardholder",
|
||||
"120": "Decline, transaction not permitted to terminal",
|
||||
"121": "Decline, exceeds withdrawal amount limit",
|
||||
"122": "Decline, security violation",
|
||||
"123": "Decline, exceeds withdrawal frequency limit",
|
||||
"124": "Decline, violation of law",
|
||||
"129": "Decline, suspected counterfeit card",
|
||||
"200": "Pick-up (general, no comments)",
|
||||
"207": "Pick-up, special conditions",
|
||||
"208": "Pick-up, lost card",
|
||||
"209": "Pick-up, stolen card",
|
||||
"902": "Decline reason message: invalid transaction",
|
||||
"907": "Decline reason message: card issuer or switch inoperative",
|
||||
"908": "Decline reason message: transaction destination cannot be found for routing",
|
||||
"909": "Decline reason message: system malfunction",
|
||||
"921": "Decline reason message: security software/hardware error - no action",
|
||||
"1001": "Perspayee data expired or missing"
|
||||
}
|
||||
},
|
||||
"integrations": {
|
||||
|
Loading…
Reference in New Issue
Block a user