@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.
- package/dist/types/src/Widgets/EligibilityModal/ModalContainer.d.ts +1 -0
- package/dist/types/src/Widgets/PaymentPlans/index.d.ts +1 -0
- package/dist/types/src/hooks/useFetchEligibility.d.ts +1 -1
- package/dist/types/src/hooks/useSessionStorage.d.ts +1 -0
- package/dist/types/src/intl/messages/messages.it.json.d.ts +4 -4
- package/dist/types/src/test/fixtures.d.ts +79 -0
- package/dist/types/src/test/index.d.ts +8 -0
- package/dist/types/src/types.d.ts +2 -0
- package/dist/widgets-wc.umd.js +16 -16
- package/dist/widgets.js +1639 -1627
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.umd.js +16 -16
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +3 -10
|
@@ -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;
|
|
@@ -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": "
|
|
21
|
-
"credit-features.information.title": "Il credito è un impegno e deve essere
|
|
22
|
-
"credit-features.legal-text": "
|
|
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
|
|
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[];
|