From 17afdd69e342e7c7a062a65f7b3bc09fc8ef46c8 Mon Sep 17 00:00:00 2001 From: Denis Ezhov Date: Wed, 20 May 2020 11:46:47 +0300 Subject: [PATCH] remove errors translation, translation for terminal (#235) --- ...ments-errors-distribution-to-chart-data.ts | 12 +--- src/assets/i18n/payment-section/ru.json | 57 +------------------ 2 files changed, 5 insertions(+), 64 deletions(-) diff --git a/src/app/sections/payment-section/analytics/payments-error-distribution/payments-errors-distribution-to-chart-data.ts b/src/app/sections/payment-section/analytics/payments-error-distribution/payments-errors-distribution-to-chart-data.ts index 5a134c6d..d1827d74 100644 --- a/src/app/sections/payment-section/analytics/payments-error-distribution/payments-errors-distribution-to-chart-data.ts +++ b/src/app/sections/payment-section/analytics/payments-error-distribution/payments-errors-distribution-to-chart-data.ts @@ -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[] diff --git a/src/assets/i18n/payment-section/ru.json b/src/assets/i18n/payment-section/ru.json index 2870eccc..0421f236 100644 --- a/src/assets/i18n/payment-section/ru.json +++ b/src/assets/i18n/payment-section/ru.json @@ -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": {