Skip to content

Commit

Permalink
Merge branch 'master' into fix-rn-screens-android-build-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowsheep1 authored Apr 12, 2024
2 parents ca74936 + 295c5e5 commit c9cb096
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"idpay_api": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v6.9.1/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml",
"lollipop_api": "https://raw.githubusercontent.com/pagopa/io-backend/v13.32.1-RELEASE/api_lollipop_first_consumer.yaml",
"fast_login_api": "https://raw.githubusercontent.com/pagopa/io-backend/v13.32.1-RELEASE/openapi/generated/api_fast_login.yaml",
"pagopa_api_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/bec0f57606a2002706bd5f5286fad3e508d2f50e/src/domains/wallet-app/api/payment-wallet/v1/_openapi.json.tpl",
"pagopa_api_ecommerce": "https://raw.githubusercontent.com/pagopa/pagopa-infra/2adee4c0a8de8570e74710379f9cccb04c6925b6/src/domains/ecommerce-app/api/ecommerce-io/v1/_openapi.json.tpl",
"pagopa_api_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/ebcc83fad083e1e7df3bcf97e9df3cd3b16e2045/src/domains/wallet-app/api/payment-wallet/v1/_openapi.json.tpl",
"pagopa_api_ecommerce": "https://raw.githubusercontent.com/pagopa/pagopa-infra/ebcc83fad083e1e7df3bcf97e9df3cd3b16e2045/src/domains/ecommerce-app/api/ecommerce-io/v1/_openapi.json.tpl",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,28 @@ const WalletPaymentPickMethodScreen = () => {
selectedWalletOption
),
O.map(([paymentAmountInCents, transaction, selectedWallet]) => {
// We can safely get this data from the first payment object
// This logic should be revisited once the cart feature will be implemented
const primaryPayment = transaction.payments[0];

const paymentToken = primaryPayment?.paymentToken;
const primaryTransfer = primaryPayment?.transferList?.[0];
const isAllCCP = primaryPayment?.isAllCCP;
const primaryCreditorInstitution = primaryTransfer?.paFiscalCode;

const transferList = transaction.payments.reduce(
(a, p) => [...a, ...(p.transferList ?? [])],
[] as ReadonlyArray<Transfer>
);
const paymentToken = transaction.payments[0]?.paymentToken;

dispatch(
paymentsCalculatePaymentFeesAction.request({
paymentToken,
paymentMethodId: selectedWallet.paymentMethodId,
walletId: selectedWallet.walletId,
paymentAmount: paymentAmountInCents,
isAllCCP,
primaryCreditorInstitution,
transferList
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Wallets } from "../../../../../../definitions/pagopa/walletv3/Wallets";
import { withRefreshApiCall } from "../../../../fastLogin/saga/utils";
import { getPaymentsWalletUserMethods } from "../../store/actions";
import { handleGetPaymentsWalletUserMethods } from "../handleGetPaymentsWalletUserMethods";
import { BrandEnum } from "../../../../../../definitions/pagopa/walletv3/WalletInfoDetails";
import { WalletCard } from "../../../../newWallet/types";
import { walletAddCards } from "../../../../newWallet/store/actions/cards";
import { getGenericError } from "../../../../../utils/errors";
Expand Down Expand Up @@ -35,7 +34,7 @@ describe("handleGetPaymentsWalletUserMethods", () => {
type: "CREDITCARD",
lastFourDigits: T_HPAN,
expiryDate: T_EXPIRE_DATE,
brand: BrandEnum.VISA
brand: "VISA"
}
}
]
Expand All @@ -47,7 +46,7 @@ describe("handleGetPaymentsWalletUserMethods", () => {
category: "payment",
walletId: T_WALLETID,
hpan: T_HPAN,
brand: BrandEnum.VISA,
brand: "VISA",
expireDate: getDateFromExpiryDate(T_EXPIRE_DATE),
abiCode: undefined,
holderEmail: undefined,
Expand Down

0 comments on commit c9cb096

Please sign in to comment.