From 8e7148e9cfb7d84164dbb22830f0f97d84043c5e Mon Sep 17 00:00:00 2001 From: Martino Cesari Tomba Date: Thu, 2 Nov 2023 12:18:49 +0100 Subject: [PATCH] updated idpay definitions --- package.json | 2 +- src/persistence/idpay.ts | 2 +- src/routers/features/idpay/__tests__/payment.test.ts | 6 +++--- src/routers/features/idpay/payment.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 6e73b1c3..a9502276 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "api_cdc": "https://raw.githubusercontent.com/pagopa/io-app/master/assets/CdcSwagger.yml", "api_fci": "https://raw.githubusercontent.com/pagopa/io-backend/v13.10.1-RELEASE/api_io_sign.yaml", "api_pn": "https://raw.githubusercontent.com/pagopa/io-backend/v13.10.1-RELEASE/api_pn.yaml", - "api_idpay": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v4.5.0/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml", + "api_idpay": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v5.8.0/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml", "api_fast_login": "https://raw.githubusercontent.com/pagopa/io-backend/v13.10.1-RELEASE/openapi/generated/api_fast_login.yaml", "api_pagopa_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/fde8d344d1eae9d16ca338d4f71095c805b99f75/src/domains/wallet-app/api/payment-wallet/v1/_openapi.json.tpl", "author": "Matteo Boschi", diff --git a/src/persistence/idpay.ts b/src/persistence/idpay.ts index bcf781b9..28ebfb83 100644 --- a/src/persistence/idpay.ts +++ b/src/persistence/idpay.ts @@ -439,7 +439,7 @@ range(0, walletConfig.discountCount).forEach(() => { instrumentId: ulid(), activationDate: new Date(), status: InstrumentStatus.ACTIVE, - instrumentType: InstrumentTypeEnum.QRCODE + instrumentType: InstrumentTypeEnum.APP_IO_PAYMENT } ] }; diff --git a/src/routers/features/idpay/__tests__/payment.test.ts b/src/routers/features/idpay/__tests__/payment.test.ts index d12000ac..bd3320b3 100644 --- a/src/routers/features/idpay/__tests__/payment.test.ts +++ b/src/routers/features/idpay/__tests__/payment.test.ts @@ -7,9 +7,9 @@ import { CodeEnum } from "../../../../../generated/definitions/idpay/Transaction export const codeToFailure: { [key: number]: { status: number; code: CodeEnum }; } = { - 1: { status: 404, code: CodeEnum.PAYMENT_NOT_FOUND_EXPIRED }, - 2: { status: 403, code: CodeEnum.PAYMENT_USER_NOT_VALID }, - 3: { status: 400, code: CodeEnum.PAYMENT_STATUS_NOT_VALID }, + 1: { status: 404, code: CodeEnum.PAYMENT_NOT_FOUND_OR_EXPIRED }, + 2: { status: 403, code: CodeEnum.PAYMENT_USER_NOT_ASSOCIATED }, + 3: { status: 400, code: CodeEnum.PAYMENT_NOT_FOUND_OR_EXPIRED }, 4: { status: 403, code: CodeEnum.PAYMENT_BUDGET_EXHAUSTED }, 5: { status: 403, code: CodeEnum.PAYMENT_GENERIC_REJECTED }, 6: { status: 429, code: CodeEnum.PAYMENT_TOO_MANY_REQUESTS }, diff --git a/src/routers/features/idpay/payment.ts b/src/routers/features/idpay/payment.ts index bfdbcfbc..44fc0727 100644 --- a/src/routers/features/idpay/payment.ts +++ b/src/routers/features/idpay/payment.ts @@ -47,9 +47,9 @@ const generateRandomTransactionError = ( export const codeToFailure: { [key: number]: { status: number; code: CodeEnum }; } = { - 1: { status: 404, code: CodeEnum.PAYMENT_NOT_FOUND_EXPIRED }, - 2: { status: 403, code: CodeEnum.PAYMENT_USER_NOT_VALID }, - 3: { status: 400, code: CodeEnum.PAYMENT_STATUS_NOT_VALID }, + 1: { status: 404, code: CodeEnum.PAYMENT_NOT_FOUND_OR_EXPIRED }, + 2: { status: 403, code: CodeEnum.PAYMENT_USER_NOT_ASSOCIATED }, + 3: { status: 400, code: CodeEnum.PAYMENT_NOT_FOUND_OR_EXPIRED }, 4: { status: 403, code: CodeEnum.PAYMENT_BUDGET_EXHAUSTED }, 5: { status: 403, code: CodeEnum.PAYMENT_GENERIC_REJECTED }, 6: { status: 429, code: CodeEnum.PAYMENT_TOO_MANY_REQUESTS },