@alma/widgets 4.2.0 → 4.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ type Props = {
6
6
  configPlans?: ConfigPlan[];
7
7
  customerBillingCountry?: string;
8
8
  customerShippingCountry?: string;
9
+ merchantCoversAllFees?: boolean;
9
10
  onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
10
11
  cards?: Card[];
11
12
  };
@@ -7,6 +7,7 @@ type Props = {
7
7
  transitionDelay?: number;
8
8
  customerBillingCountry?: string;
9
9
  customerShippingCountry?: string;
10
+ merchantCoversAllFees?: boolean;
10
11
  hideIfNotEligible?: boolean;
11
12
  monochrome?: boolean;
12
13
  suggestedPaymentPlan?: number | number[];
@@ -1,3 +1,3 @@
1
1
  import { ApiConfig, ConfigPlan, EligibilityPlan, statusResponse } from '../types';
2
- declare const useFetchEligibility: (purchaseAmount: number, { domain, merchantId }: ApiConfig, plans?: ConfigPlan[], customerBillingCountry?: string, customerShippingCountry?: string) => [EligibilityPlan[], statusResponse];
2
+ declare const useFetchEligibility: (purchaseAmount: number, { domain, merchantId }: ApiConfig, plans?: ConfigPlan[], customerBillingCountry?: string, customerShippingCountry?: string, merchantCoversAllFees?: boolean) => [EligibilityPlan[], statusResponse];
3
3
  export default useFetchEligibility;
@@ -4,6 +4,7 @@ type CreateKeyType = {
4
4
  plans?: ConfigPlan[];
5
5
  customerBillingCountry?: string;
6
6
  customerShippingCountry?: string;
7
+ merchantCoversAllFees?: boolean;
7
8
  domain?: string;
8
9
  merchantId?: string;
9
10
  };
@@ -17,9 +17,9 @@ declare const _default: {
17
17
  "accessibility.skip-links.navigation.aria-label": "Navigazione rapida",
18
18
  "accessibility.visa-card.aria-label": "Carta Visa accettata",
19
19
  "credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
20
- "credit-features.information": "Verificate la vostra capacità di rimborso prima di prendere un impegno.",
21
- "credit-features.information.title": "Il credito è un impegno e deve essere ripagato.",
22
- "credit-features.legal-text": "{totalWithoutFirstInstallment} {taegPercentage} {installmeentsCountWithoutFirst} Prestito a tasso fisso per un periodo di mesi. {firstInstallmentAmount} {productPriceWithoutCreditCost}Oltre a un deposito di , questo vi permetterà di finanziare un acquisto di . Soggetto a revisione e accettazione da parte di Alma. Periodo di recesso legale di 14 giorni. Simulazione presentata da Alma, iscritta al Registro del Commercio e delle Imprese di Nanterre con il numero 839 100 575, società di pagamento e di finanziamento approvata dall'ACPR con il numero 17408 (numero CIB / codice bancario).",
20
+ "credit-features.information": "Prima di procedere, assicurati di poter rispettare il tuo impegno finanziario.",
21
+ "credit-features.information.title": "Il credito è un impegno e deve essere rimborsato.",
22
+ "credit-features.legal-text": "Prestito a tasso fisso di un importo pari a {totalWithoutFirstInstallment} al tasso {taegPercentage} per un periodo di {installmeentsCountWithoutFirst} mesi. Oltre a un deposito di {firstInstallmentAmount}, questo vi permetterà di finanziare un acquisto di {productPriceWithoutCreditCost}. Soggetto a revisione e accettazione da parte di Alma. Periodo di recesso legale di 14 giorni. Simulazione presentata da Alma, iscritta al Registro del Commercio e delle Imprese di Nanterre con il numero 839 100 575, società di pagamento e di finanziamento approvata dall'ACPR con il numero 17408 (numero CIB / codice bancario).",
23
23
  "credit-features.total-credit-cost": "Di cui commissioni",
24
24
  "eligibility-modal.bullet-1": "Seleziona <strong>Alma</strong> come metodo di pagamento.",
25
25
  "eligibility-modal.bullet-2": "Segui le istruzioni e completa l'acquisto <strong>in meno di 2 minuti.</strong>",
@@ -37,7 +37,7 @@ declare const _default: {
37
37
  "installments.total-fees": "Di cui commissioni",
38
38
  "payment-plan-strings.credit": "Clicca qui per saperne di più",
39
39
  "payment-plan-strings.day-abbreviation": "G{deferredDays}",
40
- "payment-plan-strings.default-message": "Paga a rate con Alma, senza registrazione.",
40
+ "payment-plan-strings.default-message": "Paga a rate con Alma",
41
41
  "payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
42
42
  "payment-plan-strings.deferred.days": "{days, number} {days, plural, one {giorno} other {giorni}}",
43
43
  "payment-plan-strings.deferred.months": "{months, number} {months, plural, one {mesi} other {mesi}}",
@@ -0,0 +1,79 @@
1
+ import { ConfigPlan, EligibilityPlan } from '../types';
2
+ export declare const mockPlansAllEligible: EligibilityPlan[];
3
+ export declare const mockButtonPlans: ({
4
+ customer_total_cost_amount: number;
5
+ customer_total_cost_bps: number;
6
+ deferred_days: number;
7
+ deferred_months: number;
8
+ eligible: boolean;
9
+ installments_count: number;
10
+ payment_plan: {
11
+ customer_fee: number;
12
+ customer_interest: number;
13
+ due_date: number;
14
+ purchase_amount: number;
15
+ total_amount: number;
16
+ }[];
17
+ purchase_amount: number;
18
+ annual_interest_rate?: undefined;
19
+ } | {
20
+ annual_interest_rate: number;
21
+ customer_total_cost_amount: number;
22
+ customer_total_cost_bps: number;
23
+ deferred_days: number;
24
+ deferred_months: number;
25
+ eligible: boolean;
26
+ installments_count: number;
27
+ payment_plan: {
28
+ customer_fee: number;
29
+ customer_interest: number;
30
+ due_date: number;
31
+ purchase_amount: number;
32
+ refunded_interest: number;
33
+ total_amount: number;
34
+ }[];
35
+ purchase_amount: number;
36
+ })[];
37
+ export declare const mockEligibilityPaymentPlanWithIneligiblePlan: ({
38
+ customer_fee: number;
39
+ customer_interest: number;
40
+ customer_total_cost_amount: number;
41
+ customer_total_cost_bps: number;
42
+ deferred_days: number;
43
+ deferred_months: number;
44
+ eligible: boolean;
45
+ installments_count: number;
46
+ payment_plan: {
47
+ customer_fee: number;
48
+ customer_interest: number;
49
+ due_date: number;
50
+ purchase_amount: number;
51
+ total_amount: number;
52
+ }[];
53
+ purchase_amount: number;
54
+ constraints?: undefined;
55
+ reasons?: undefined;
56
+ } | {
57
+ constraints: {
58
+ purchase_amount: {
59
+ maximum: number;
60
+ minimum: number;
61
+ };
62
+ };
63
+ deferred_days: number;
64
+ deferred_months: number;
65
+ eligible: boolean;
66
+ installments_count: number;
67
+ purchase_amount: number;
68
+ reasons: {
69
+ purchase_amount: string;
70
+ };
71
+ customer_fee?: undefined;
72
+ customer_interest?: undefined;
73
+ customer_total_cost_amount?: undefined;
74
+ customer_total_cost_bps?: undefined;
75
+ payment_plan?: undefined;
76
+ })[];
77
+ export declare const mockPlansWithoutDeferred: EligibilityPlan[];
78
+ export declare const mockPayNowPlan: EligibilityPlan[];
79
+ export declare const configPlans: ConfigPlan[];
@@ -0,0 +1,8 @@
1
+ import { default as React } from '../../preact/compat';
2
+ import { RenderResult } from '@testing-library/react';
3
+ import { Locale } from '../types';
4
+ type Props = {
5
+ locale: Locale;
6
+ };
7
+ declare const renderWithProviders: (ui: React.ReactNode, { locale }?: Props) => RenderResult;
8
+ export default renderWithProviders;
@@ -84,6 +84,7 @@ export type PaymentPlanWidgetOptions = {
84
84
  hideBorder?: boolean;
85
85
  customerBillingCountry?: string;
86
86
  customerShippingCountry?: string;
87
+ merchantCoversAllFees?: boolean;
87
88
  onModalClose?: (event: React.MouseEvent | React.KeyboardEvent) => void;
88
89
  };
89
90
  export type ModalOptions = {
@@ -92,6 +93,7 @@ export type ModalOptions = {
92
93
  purchaseAmount: number;
93
94
  customerBillingCountry?: string;
94
95
  customerShippingCountry?: string;
96
+ merchantCoversAllFees?: boolean;
95
97
  plans?: ConfigPlan[];
96
98
  locale?: Locale;
97
99
  cards?: Card[];