diff --git a/packages/client/src/payments/types/paymentInstrument.types.ts b/packages/client/src/payments/types/paymentInstrument.types.ts index cbd05c5e7..58756782d 100644 --- a/packages/client/src/payments/types/paymentInstrument.types.ts +++ b/packages/client/src/payments/types/paymentInstrument.types.ts @@ -5,6 +5,10 @@ import type { ShopperInteraction, } from './index.js'; +export type InstrumentInstallment = { + quantity: number; +}; + export enum PaymentInstrumentStatus { Created = 'Created', Pending = 'Pending', diff --git a/packages/client/src/payments/types/paymentMethods.types.ts b/packages/client/src/payments/types/paymentMethods.types.ts index b56d18e2f..d6bb67c30 100644 --- a/packages/client/src/payments/types/paymentMethods.types.ts +++ b/packages/client/src/payments/types/paymentMethods.types.ts @@ -22,7 +22,9 @@ export type CreditCard = { export type CreditCardPaymentMethod = { type: string; - creditCards: CreditCard[]; + creditCards?: CreditCard[]; + supportsInstallments?: boolean; + installments?: number[]; }; export type PaymentMethods = { diff --git a/packages/client/src/payments/types/postPaymentIntentInstrument.types.ts b/packages/client/src/payments/types/postPaymentIntentInstrument.types.ts index 36369e345..f0085fe01 100644 --- a/packages/client/src/payments/types/postPaymentIntentInstrument.types.ts +++ b/packages/client/src/payments/types/postPaymentIntentInstrument.types.ts @@ -1,5 +1,6 @@ import type { Amounts, + InstrumentInstallment, Issuer, PayerAddressType, PayerInput, @@ -50,6 +51,7 @@ export type PostPaymentIntentInstrumentData = { payer?: PayerInput; amounts: Amounts[]; data?: CreatePaymentInstrumentData; + installments?: InstrumentInstallment; shopperInteraction?: ShopperInteraction; }; diff --git a/packages/client/src/payments/types/putPaymentIntentInstrument.types.ts b/packages/client/src/payments/types/putPaymentIntentInstrument.types.ts index c1eb338d0..36eded43e 100644 --- a/packages/client/src/payments/types/putPaymentIntentInstrument.types.ts +++ b/packages/client/src/payments/types/putPaymentIntentInstrument.types.ts @@ -1,5 +1,6 @@ import type { Amounts, + InstrumentInstallment, PayerAddressType, PayerInput, PaymentInstrument, @@ -12,6 +13,7 @@ export type PutPaymentIntentInstrumentData = { createToken?: boolean; payer?: PayerInput; amounts: Amounts[]; + installments?: InstrumentInstallment; shopperInteraction?: ShopperInteraction; payerAddressType?: PayerAddressType; }; diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/createCheckoutOrder.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/createCheckoutOrder.test.ts.snap index 7a10d89f3..a9b80c27a 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/createCheckoutOrder.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/createCheckoutOrder.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrder.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrder.test.ts.snap index fc715be10..81bd99dd8 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrder.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrder.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrderPaymentMethods.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrderPaymentMethods.test.ts.snap index 769b74443..91a0bd84e 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrderPaymentMethods.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/fetchCheckoutOrderPaymentMethods.test.ts.snap @@ -50,6 +50,8 @@ Object { "id": "e13bb06b-392b-49a0-8acd-3f44416e3234", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "CreditCard", }, "customerAccounts": Array [ @@ -148,6 +150,8 @@ Object { "id": "e13bb06b-392b-49a0-8acd-3f44416e3234", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "CreditCard", }, "customerAccounts": Array [ diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/removeCheckoutOrderPromocodes.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/removeCheckoutOrderPromocodes.test.ts.snap index fe7922a7f..b496c7340 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/removeCheckoutOrderPromocodes.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/removeCheckoutOrderPromocodes.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderItemTags.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderItemTags.test.ts.snap index 4a15db222..5bf4a674b 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderItemTags.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderItemTags.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderPromocodes.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderPromocodes.test.ts.snap index 7448d8576..2be92edd6 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderPromocodes.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderPromocodes.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderTags.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderTags.test.ts.snap index b4a67b2ad..7866685ce 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderTags.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/setCheckoutOrderTags.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/checkout/actions/__tests__/__snapshots__/updateCheckoutOrder.test.ts.snap b/packages/redux/src/checkout/actions/__tests__/__snapshots__/updateCheckoutOrder.test.ts.snap index 4b431aacc..84768b0c9 100644 --- a/packages/redux/src/checkout/actions/__tests__/__snapshots__/updateCheckoutOrder.test.ts.snap +++ b/packages/redux/src/checkout/actions/__tests__/__snapshots__/updateCheckoutOrder.test.ts.snap @@ -40,6 +40,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], @@ -484,6 +486,8 @@ Object { "id": "", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "", }, "customerAccounts": Array [], diff --git a/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByCountryAndCurrency.test.ts.snap b/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByCountryAndCurrency.test.ts.snap index c26925068..b5b4ca327 100644 --- a/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByCountryAndCurrency.test.ts.snap +++ b/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByCountryAndCurrency.test.ts.snap @@ -46,6 +46,8 @@ Object { "id": "e13bb06b-392b-49a0-8acd-3f44416e3234", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "CreditCard", }, "customerAccounts": Array [ diff --git a/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByIntent.test.ts.snap b/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByIntent.test.ts.snap index 657745ec6..0495bb004 100644 --- a/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByIntent.test.ts.snap +++ b/packages/redux/src/payments/actions/__tests__/__snapshots__/fetchPaymentMethodsByIntent.test.ts.snap @@ -46,6 +46,8 @@ Object { "id": "e13bb06b-392b-49a0-8acd-3f44416e3234", }, ], + "installments": Array [], + "supportsInstallments": false, "type": "CreditCard", }, "customerAccounts": Array [ diff --git a/tests/__fixtures__/checkout/checkout.fixtures.mts b/tests/__fixtures__/checkout/checkout.fixtures.mts index 255c5ec1d..04c74c275 100644 --- a/tests/__fixtures__/checkout/checkout.fixtures.mts +++ b/tests/__fixtures__/checkout/checkout.fixtures.mts @@ -435,6 +435,8 @@ export const mockResponse = { creditCard: { type: '', creditCards: [{ id: '', description: '', code: '' }], + supportsInstallments: false, + installments: [], }, }, userPaymentTokens: undefined, @@ -928,6 +930,8 @@ export const mockUpdateCheckoutResponse = { code: '', }, ], + supportsInstallments: false, + installments: [], }, }, orderStatus: OrderStatusError.NoError, diff --git a/tests/__fixtures__/payments/payments.fixtures.mts b/tests/__fixtures__/payments/payments.fixtures.mts index dd14cfdae..bd6ae11b6 100644 --- a/tests/__fixtures__/payments/payments.fixtures.mts +++ b/tests/__fixtures__/payments/payments.fixtures.mts @@ -336,6 +336,8 @@ export const mockFetchPaymentMethodsResponse = { code: 'VISA', }, ], + supportsInstallments: false, + installments: [], }, }; export const mockFetchPaymentIntentChargeResponse = {