diff --git a/package.json b/package.json index 4edc64a1..0ff266e1 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "api_pn": "https://raw.githubusercontent.com/pagopa/io-backend/v13.25.1-RELEASE/api_pn.yaml", "api_idpay": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v6.5.0/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml", "api_fast_login": "https://raw.githubusercontent.com/pagopa/io-backend/v13.25.1-RELEASE/openapi/generated/api_fast_login.yaml", - "api_pagopa_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/4cd111e94432ff62580adc391de78a5462a7128e/src/domains/wallet-app/api/payment-wallet/v1/_openapi.json.tpl", - "api_pagopa_ecommerce": "https://raw.githubusercontent.com/pagopa/pagopa-infra/65878f9913fcc0eaff499ba8a1a20427a412c010/src/domains/ecommerce-app/api/ecommerce-io/v1/_openapi.json.tpl", + "api_pagopa_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/740e7dcc5ea2ea19639316fea6797bbd504dd0ae/src/domains/wallet-app/api/payment-wallet/v1/_openapi.json.tpl", + "api_pagopa_ecommerce": "https://raw.githubusercontent.com/pagopa/pagopa-infra/5190135ac34791cf66c1986735d4134bcaf4096f/src/domains/ecommerce-app/api/ecommerce-io/v1/_openapi.json.tpl", "author": "Matteo Boschi", "license": "MIT", "private": false, diff --git a/src/features/wallet/payloads/paymentMethods.ts b/src/features/wallet/payloads/paymentMethods.ts index 5533c910..a0015225 100644 --- a/src/features/wallet/payloads/paymentMethods.ts +++ b/src/features/wallet/payloads/paymentMethods.ts @@ -1,7 +1,6 @@ import { PaymentMethodStatusEnum } from "../../../../generated/definitions/pagopa/walletv3/PaymentMethodStatus"; import { PaymentMethodsResponse } from "../../../../generated/definitions/pagopa/walletv3/PaymentMethodsResponse"; import { Range } from "../../../../generated/definitions/pagopa/walletv3/Range"; -import { TypeEnum } from "../../../../generated/definitions/pagopa/walletv3/WalletInfoDetails"; export const allPaymentMethods: PaymentMethodsResponse = { paymentMethods: [ @@ -11,7 +10,7 @@ export const allPaymentMethods: PaymentMethodsResponse = { description: "Carta di credito", asset: "creditCard", status: PaymentMethodStatusEnum.ENABLED, - paymentTypeCode: TypeEnum.CARDS, + paymentTypeCode: "CARDS", ranges: [ { min: 0, @@ -25,7 +24,7 @@ export const allPaymentMethods: PaymentMethodsResponse = { description: "PayPal", asset: "payPal", status: PaymentMethodStatusEnum.ENABLED, - paymentTypeCode: TypeEnum.PAYPAL, + paymentTypeCode: "PAYPAL", ranges: [ { min: 0, diff --git a/src/features/wallet/payloads/transactions.ts b/src/features/wallet/payloads/transactions.ts index f8938597..f64af559 100644 --- a/src/features/wallet/payloads/transactions.ts +++ b/src/features/wallet/payloads/transactions.ts @@ -44,7 +44,7 @@ export const getTransactionInfoPayload = ( }); export const getCalculateFeeResponsePayload = ( - _walletId: string, + _walletId: string | undefined, _amount: number ): O.Option => O.some({ diff --git a/src/features/wallet/utils/onboarding.ts b/src/features/wallet/utils/onboarding.ts index 26ada62e..7e17f253 100644 --- a/src/features/wallet/utils/onboarding.ts +++ b/src/features/wallet/utils/onboarding.ts @@ -2,7 +2,6 @@ import { faker } from "@faker-js/faker"; import { WalletCreateResponse } from "../../../../generated/definitions/pagopa/walletv3/WalletCreateResponse"; import { serverUrl } from "../../../utils/server"; import { PaymentMethodsResponse } from "../../../../generated/definitions/pagopa/walletv3/PaymentMethodsResponse"; -import { TypeEnum } from "../../../../generated/definitions/pagopa/walletv3/WalletInfoDetails"; import { allPaymentMethods } from "../payloads/paymentMethods"; export const generateOnboardablePaymentMethods = (): PaymentMethodsResponse => @@ -10,9 +9,9 @@ export const generateOnboardablePaymentMethods = (): PaymentMethodsResponse => export const getWalletTypeFromPaymentMethodId = ( paymentMethodId: string -): TypeEnum => +): string => allPaymentMethods.paymentMethods?.find(({ id }) => id === paymentMethodId) - ?.paymentTypeCode as TypeEnum; + ?.paymentTypeCode || "CARDS"; export const WALLET_ONBOARDING_PATH = "/wallets/outcomes"; export const generateOnboardingWalletData = ( diff --git a/src/routers/features/idpay/__tests__/payment.test.ts b/src/routers/features/idpay/__tests__/payment.test.ts index bd3320b3..925c25ea 100644 --- a/src/routers/features/idpay/__tests__/payment.test.ts +++ b/src/routers/features/idpay/__tests__/payment.test.ts @@ -74,7 +74,7 @@ describe("IDPay Payment API", () => { describe("DELETE deletePayment", () => { it("should return 200", async () => { - const trxCode = faker.random.alphaNumeric(8, { bannedChars: "1234567" }); + const trxCode = "ABCDEFGH"; const response = await request.delete( addIdPayPrefix(`/payment/qr-code/${trxCode}`)