@alma/widgets 3.2.1 → 3.2.3
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/raw/widgets.js +183 -85
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +183 -85
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +133 -43
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +183 -85
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +4 -2
- package/dist/types/Widgets/EligibilityModal/components/Info/index.d.ts +3 -1
- package/dist/types/utils/filterEligibility.d.ts +2 -2
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1551,6 +1551,7 @@ function formatCents(cents) {
|
|
|
1551
1551
|
return String(priceFromCents(cents)).replace('.', ',');
|
|
1552
1552
|
}
|
|
1553
1553
|
const desktopWidth = 800;
|
|
1554
|
+
const isP1X = plan => (plan == null ? void 0 : plan.installments_count) === 1 && (plan == null ? void 0 : plan.deferred_days) === 0 && (plan == null ? void 0 : plan.deferred_months) === 0;
|
|
1554
1555
|
|
|
1555
1556
|
/* eslint-disable */
|
|
1556
1557
|
|
|
@@ -1863,21 +1864,26 @@ var messagesDE = {
|
|
|
1863
1864
|
"credit-features.total-credit-cost": "Davon Kreditkosten",
|
|
1864
1865
|
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> beim Check-out. ",
|
|
1865
1866
|
"eligibility-modal.bullet-2": "Lassen Sie sich führen und bestätigen Sie Ihre Zahlung in <strong>2 Minuten.</strong>",
|
|
1866
|
-
"eligibility-modal.bullet-3": "
|
|
1867
|
+
"eligibility-modal.bullet-3": "</strong>Verlieren Sie nicht die Kontrolle,</strong> indem Sie Ihre Fälligkeitstermine nach Ihrem eigenen Tempo vor- oder zurückverlegen.",
|
|
1867
1868
|
"eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
|
|
1869
|
+
"eligibility-modal.p1x-bullet-1": "Wählen Sie <strong>Alma - 1X</strong> beim Check-out.",
|
|
1870
|
+
"eligibility-modal.p1x-bullet-2": "Tragen Sie Ihre <strong>Kreditkarteninformationen ein.</strong>",
|
|
1871
|
+
"eligibility-modal.p1x-bullet-3": "<strong> Ihre Zahlung wird sofort bestätigt! </strong>",
|
|
1868
1872
|
"eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
|
|
1869
1873
|
"eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
|
|
1870
1874
|
"installments.today": "Heute",
|
|
1871
1875
|
"installments.total-amount": "Gesamtsumme",
|
|
1872
1876
|
"installments.total-fees": "Davon Kosten",
|
|
1873
|
-
"payment-plan-strings.day-abbreviation": "T{
|
|
1877
|
+
"payment-plan-strings.day-abbreviation": "T{deferredDays}",
|
|
1874
1878
|
"payment-plan-strings.default-message": "Bezahlen Sie zinsfrei in mehreren Raten mit Alma.",
|
|
1875
1879
|
"payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
|
|
1876
1880
|
"payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
|
|
1877
1881
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1882
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1878
1883
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1879
1884
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1880
|
-
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1885
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)",
|
|
1886
|
+
"payment-plan-strings.pay-now": "Zahlen Sie jetzt {totalAmount}"
|
|
1881
1887
|
};
|
|
1882
1888
|
|
|
1883
1889
|
var messagesEN = {
|
|
@@ -1888,19 +1894,24 @@ var messagesEN = {
|
|
|
1888
1894
|
"eligibility-modal.bullet-2": "Let us guide you and validate your payment in <strong>2 minutes.</strong>",
|
|
1889
1895
|
"eligibility-modal.bullet-3": "<strong>Stay in control</strong> by moving your deadlines forward or backward at your own pace.",
|
|
1890
1896
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1897
|
+
"eligibility-modal.p1x-bullet-1": "Choose <strong>Alma - 1X</strong> at checkout.",
|
|
1898
|
+
"eligibility-modal.p1x-bullet-2": "Fill in your <strong>credit card information.</strong>",
|
|
1899
|
+
"eligibility-modal.p1x-bullet-3": "<strong>The validation </strong> of your payment is instantaneous!",
|
|
1891
1900
|
"eligibility-modal.title-deferred-plan": "Pay in installments or later by credit card with Alma.",
|
|
1892
1901
|
"eligibility-modal.title-normal": "Pay in installments by credit card with Alma.",
|
|
1893
1902
|
"installments.today": "Today",
|
|
1894
1903
|
"installments.total-amount": "Total",
|
|
1895
1904
|
"installments.total-fees": "Of which costs (incl. VAT)",
|
|
1896
|
-
"payment-plan-strings.day-abbreviation": "D{
|
|
1905
|
+
"payment-plan-strings.day-abbreviation": "D{deferredDays}",
|
|
1897
1906
|
"payment-plan-strings.default-message": "Pay in installments with Alma",
|
|
1898
|
-
"payment-plan-strings.deferred": "{totalAmount} to
|
|
1907
|
+
"payment-plan-strings.deferred": "{totalAmount} to pay the {dueDate}",
|
|
1899
1908
|
"payment-plan-strings.ineligible-greater-than-max": "Until {maxAmount}",
|
|
1900
1909
|
"payment-plan-strings.ineligible-lower-than-min": "From {minAmount}",
|
|
1910
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1901
1911
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1902
1912
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1903
|
-
"payment-plan-strings.no-fee": "(free of charge)"
|
|
1913
|
+
"payment-plan-strings.no-fee": "(free of charge)",
|
|
1914
|
+
"payment-plan-strings.pay-now": "Pay now {totalAmount}"
|
|
1904
1915
|
};
|
|
1905
1916
|
|
|
1906
1917
|
var messagesES = {
|
|
@@ -1911,19 +1922,24 @@ var messagesES = {
|
|
|
1911
1922
|
"eligibility-modal.bullet-2": "Déjese guiar y valide su pago en <strong>2 minutos.</strong>",
|
|
1912
1923
|
"eligibility-modal.bullet-3": "<strong>Mantenga el control</strong> adelantando o retrasando los plazos a su propio ritmo.",
|
|
1913
1924
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1925
|
+
"eligibility-modal.p1x-bullet-1": "Elija <strong>Alma - 1X</strong> en la caja.",
|
|
1926
|
+
"eligibility-modal.p1x-bullet-2": "Introduzca los datos de su tarjeta de crédito en <strong>.</strong>",
|
|
1927
|
+
"eligibility-modal.p1x-bullet-3": "<strong>¡La validación </strong> de su pago es instantánea!",
|
|
1914
1928
|
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1915
1929
|
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1916
1930
|
"installments.today": "Hoy",
|
|
1917
1931
|
"installments.total-amount": "Total",
|
|
1918
1932
|
"installments.total-fees": "De los cuales, costes (IVA incluido)",
|
|
1919
|
-
"payment-plan-strings.day-abbreviation": "D{
|
|
1933
|
+
"payment-plan-strings.day-abbreviation": "D{deferredDays}",
|
|
1920
1934
|
"payment-plan-strings.default-message": "Pagar a plazos con Alma",
|
|
1921
1935
|
"payment-plan-strings.deferred": "{totalAmount} a pagar el {dueDate}",
|
|
1922
1936
|
"payment-plan-strings.ineligible-greater-than-max": "Hasta {maxAmount}",
|
|
1923
1937
|
"payment-plan-strings.ineligible-lower-than-min": "Desde {minAmount}",
|
|
1938
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1924
1939
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidad de {othersInstallmentAmount}} other {{firstInstallmentAmount} hoy, después {numberOfRemainingInstallments} mensualidades de {othersInstallmentAmount}}}",
|
|
1925
1940
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} plazos de {totalAmount}",
|
|
1926
|
-
"payment-plan-strings.no-fee": "(sin intereses)"
|
|
1941
|
+
"payment-plan-strings.no-fee": "(sin intereses)",
|
|
1942
|
+
"payment-plan-strings.pay-now": "Pague ahora {totalAmount}"
|
|
1927
1943
|
};
|
|
1928
1944
|
|
|
1929
1945
|
var messagesFR = {
|
|
@@ -1934,42 +1950,52 @@ var messagesFR = {
|
|
|
1934
1950
|
"eligibility-modal.bullet-2": "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
1935
1951
|
"eligibility-modal.bullet-3": "<strong>Gardez le contrôle</strong> en avançant ou reculant vos échéances à votre rythme.",
|
|
1936
1952
|
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1953
|
+
"eligibility-modal.p1x-bullet-1": "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
1954
|
+
"eligibility-modal.p1x-bullet-2": "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
1955
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La validation </strong> de votre paiement est instantanée !",
|
|
1937
1956
|
"eligibility-modal.title-deferred-plan": "Payez en plusieurs fois ou plus tard par carte bancaire avec Alma.",
|
|
1938
1957
|
"eligibility-modal.title-normal": "Payez en plusieurs fois par carte bancaire avec Alma.",
|
|
1939
1958
|
"installments.today": "Aujourd'hui",
|
|
1940
1959
|
"installments.total-amount": "Total",
|
|
1941
1960
|
"installments.total-fees": "Dont frais (TTC)",
|
|
1942
|
-
"payment-plan-strings.day-abbreviation": "J{
|
|
1961
|
+
"payment-plan-strings.day-abbreviation": "J{deferredDays}",
|
|
1943
1962
|
"payment-plan-strings.default-message": "Payez en plusieurs fois avec Alma",
|
|
1944
1963
|
"payment-plan-strings.deferred": "{totalAmount} à payer le {dueDate}",
|
|
1945
1964
|
"payment-plan-strings.ineligible-greater-than-max": "Jusqu'à {maxAmount}",
|
|
1946
1965
|
"payment-plan-strings.ineligible-lower-than-min": "À partir de {minAmount}",
|
|
1966
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1947
1967
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1948
1968
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1949
|
-
"payment-plan-strings.no-fee": "(sans frais)"
|
|
1969
|
+
"payment-plan-strings.no-fee": "(sans frais)",
|
|
1970
|
+
"payment-plan-strings.pay-now": "Payez maintenant {totalAmount}"
|
|
1950
1971
|
};
|
|
1951
1972
|
|
|
1952
1973
|
var messagesIT = {
|
|
1953
1974
|
"credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
|
|
1954
1975
|
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
|
|
1955
1976
|
"credit-features.total-credit-cost": "Di cui commissioni",
|
|
1956
|
-
"eligibility-modal.bullet-1": "
|
|
1957
|
-
"eligibility-modal.bullet-2": "
|
|
1958
|
-
"eligibility-modal.bullet-3": "<strong>
|
|
1977
|
+
"eligibility-modal.bullet-1": "Seleziona <strong>Alma</strong> come metodo di pagamento.",
|
|
1978
|
+
"eligibility-modal.bullet-2": "Segui le istruzioni e completa l'acquisto <strong>in meno di 2 minuti.</strong>",
|
|
1979
|
+
"eligibility-modal.bullet-3": "<strong>Gestisci il tuo piano di pagamento</strong> e modifica le scadenze secondo le tue esigenze.",
|
|
1959
1980
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
1960
|
-
"eligibility-modal.
|
|
1981
|
+
"eligibility-modal.p1x-bullet-1": "Scegli <strong>Alma - 1X</strong> alla cassa.",
|
|
1982
|
+
"eligibility-modal.p1x-bullet-2": "Inserisci i dati della tua <strong>carta bancaria.</strong>",
|
|
1983
|
+
"eligibility-modal.p1x-bullet-3": "Ricevi la conferma di pagamento <strong>istantaneamente!</strong>",
|
|
1984
|
+
"eligibility-modal.title-deferred-plan": "Paga a rate con Alma, senza registrazione.",
|
|
1961
1985
|
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1962
1986
|
"installments.today": "Oggi",
|
|
1963
1987
|
"installments.total-amount": "Totale",
|
|
1964
1988
|
"installments.total-fees": "Di cui commissioni",
|
|
1965
|
-
"payment-plan-strings.day-abbreviation": "G{
|
|
1966
|
-
"payment-plan-strings.default-message": "Paga a rate con Alma",
|
|
1989
|
+
"payment-plan-strings.day-abbreviation": "G{deferredDays}",
|
|
1990
|
+
"payment-plan-strings.default-message": "Paga a rate con Alma, senza registrazione.",
|
|
1967
1991
|
"payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
|
|
1968
1992
|
"payment-plan-strings.ineligible-greater-than-max": "Disponibile fino a {maxAmount}",
|
|
1969
1993
|
"payment-plan-strings.ineligible-lower-than-min": "Pagamento rateale disponibile a partire da {minAmount}",
|
|
1994
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1970
1995
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {Oggi paghi {firstInstallmentAmount} poi tra {numberOfRemainingInstallments} mese {othersInstallmentAmount}} other {Oggi paghi {firstInstallmentAmount} poi {numberOfRemainingInstallments} rate mensili di {othersInstallmentAmount}}}",
|
|
1971
1996
|
"payment-plan-strings.multiple-installments-same-amount": "In {installmentsCount} rate mensili di {totalAmount}",
|
|
1972
|
-
"payment-plan-strings.no-fee": "(senza interessi)"
|
|
1997
|
+
"payment-plan-strings.no-fee": "(senza interessi)",
|
|
1998
|
+
"payment-plan-strings.pay-now": "Paga ora {totalAmount}"
|
|
1973
1999
|
};
|
|
1974
2000
|
|
|
1975
2001
|
var messagesNL = {
|
|
@@ -1980,19 +2006,24 @@ var messagesNL = {
|
|
|
1980
2006
|
"eligibility-modal.bullet-2": "Laat ons u begeleiden en uw betaling valideren in <strong>2 minuten.</strong>",
|
|
1981
2007
|
"eligibility-modal.bullet-3": "<strong>Houd de controle op</strong> door uw deadlines in uw eigen tempo vooruit of achteruit te schuiven.",
|
|
1982
2008
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
2009
|
+
"eligibility-modal.p1x-bullet-1": "Kies <strong>Alma - 1X</strong> bij het afrekenen.",
|
|
2010
|
+
"eligibility-modal.p1x-bullet-2": "Vul uw <strong>creditcardgegevens in.</strong>",
|
|
2011
|
+
"eligibility-modal.p1x-bullet-3": "<strong>De validatie </strong> van uw betaling is onmiddellijk!",
|
|
1983
2012
|
"eligibility-modal.title-deferred-plan": "Betaal in termijnen of later per creditcard met Alma.",
|
|
1984
2013
|
"eligibility-modal.title-normal": "Betaal in termijnen met een creditcard bij Alma.",
|
|
1985
2014
|
"installments.today": "Tegenwoordig",
|
|
1986
2015
|
"installments.total-amount": "Totaal",
|
|
1987
2016
|
"installments.total-fees": "Waarvan kosten (incl. BTW)",
|
|
1988
|
-
"payment-plan-strings.day-abbreviation": "D{
|
|
2017
|
+
"payment-plan-strings.day-abbreviation": "D{deferredDays}",
|
|
1989
2018
|
"payment-plan-strings.default-message": "Betaal in termijnen met Alma",
|
|
1990
2019
|
"payment-plan-strings.deferred": "{totalAmount} te betalen op {dueDate}",
|
|
1991
2020
|
"payment-plan-strings.ineligible-greater-than-max": "Tot {maxAmount}",
|
|
1992
2021
|
"payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
|
|
2022
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
1993
2023
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1994
2024
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1995
|
-
"payment-plan-strings.no-fee": "(zonder kosten)"
|
|
2025
|
+
"payment-plan-strings.no-fee": "(zonder kosten)",
|
|
2026
|
+
"payment-plan-strings.pay-now": "Betaal nu {totalAmount}"
|
|
1996
2027
|
};
|
|
1997
2028
|
|
|
1998
2029
|
var messagesPT = {
|
|
@@ -2003,19 +2034,24 @@ var messagesPT = {
|
|
|
2003
2034
|
"eligibility-modal.bullet-2": "Deixe-nos guiá-lo e validar o seu pagamento em <strong>2 minutos.</strong>",
|
|
2004
2035
|
"eligibility-modal.bullet-3": "<strong>Mantenha-se em controlo</strong> avançando ou recuando os seus prazos ao seu próprio ritmo.",
|
|
2005
2036
|
"eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
|
|
2037
|
+
"eligibility-modal.p1x-bullet-1": "Escolher <strong>Alma - 1X</strong> no checkout.",
|
|
2038
|
+
"eligibility-modal.p1x-bullet-2": "Preencha as informações do seu <strong>cartão de crédito.</strong>",
|
|
2039
|
+
"eligibility-modal.p1x-bullet-3": "<strong>A validação </strong> do seu pagamento é instantânea!",
|
|
2006
2040
|
"eligibility-modal.title-deferred-plan": "Pagar em prestações ou mais tarde por cartão de crédito com Alma.",
|
|
2007
2041
|
"eligibility-modal.title-normal": "Pagar em prestações por cartão de crédito com Alma.",
|
|
2008
2042
|
"installments.today": "Hoje",
|
|
2009
2043
|
"installments.total-amount": "Total",
|
|
2010
2044
|
"installments.total-fees": "Dos quais custos (incl. IVA)",
|
|
2011
|
-
"payment-plan-strings.day-abbreviation": "D{
|
|
2045
|
+
"payment-plan-strings.day-abbreviation": "D{deferredDays}",
|
|
2012
2046
|
"payment-plan-strings.default-message": "Pague em prestações através da Alma",
|
|
2013
2047
|
"payment-plan-strings.deferred": "{totalAmount} a pagar em {dueDate}",
|
|
2014
2048
|
"payment-plan-strings.ineligible-greater-than-max": "Até {maxAmount}",
|
|
2015
2049
|
"payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
|
|
2050
|
+
"payment-plan-strings.month-abbreviation": "M{deferredMonths}",
|
|
2016
2051
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2017
2052
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2018
|
-
"payment-plan-strings.no-fee": "(sem encargos)"
|
|
2053
|
+
"payment-plan-strings.no-fee": "(sem encargos)",
|
|
2054
|
+
"payment-plan-strings.pay-now": "Pague agora {totalAmount}"
|
|
2019
2055
|
};
|
|
2020
2056
|
|
|
2021
2057
|
const getTranslationsByLocale = locale => {
|
|
@@ -2124,16 +2160,14 @@ const getPaymentPlanBoundaries = (plan, configPlan) => {
|
|
|
2124
2160
|
return configPlan != null ? configPlan : {};
|
|
2125
2161
|
};
|
|
2126
2162
|
|
|
2127
|
-
const
|
|
2128
|
-
// Remove
|
|
2129
|
-
const filteredEligibilityPlans = eligibilities.filter(plan => !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0)); // If no configPlans was provided, return eligibility response
|
|
2130
|
-
|
|
2163
|
+
const filterEligibility = (eligibilities, configPlans) => {
|
|
2164
|
+
// Remove P1X if no configuration is provided
|
|
2131
2165
|
if (!configPlans) {
|
|
2132
|
-
return
|
|
2166
|
+
return eligibilities.filter(plan => !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0));
|
|
2133
2167
|
} // Else check if the plan is eligible regarding the related configPlan
|
|
2134
2168
|
|
|
2135
2169
|
|
|
2136
|
-
return
|
|
2170
|
+
return eligibilities.map(plan => {
|
|
2137
2171
|
const eligibilityDeferredDays = (plan.deferred_months ? plan.deferred_months : 0) * 30 + (plan.deferred_days ? plan.deferred_days : 0); // find the related configPlan
|
|
2138
2172
|
|
|
2139
2173
|
const relatedConfigPlan = configPlans.find(configPlan => {
|
|
@@ -2190,7 +2224,7 @@ const useFetchEligibility = (purchaseAmount, {
|
|
|
2190
2224
|
});
|
|
2191
2225
|
}
|
|
2192
2226
|
}, [status]);
|
|
2193
|
-
return [
|
|
2227
|
+
return [filterEligibility(eligibility, plans), status];
|
|
2194
2228
|
};
|
|
2195
2229
|
|
|
2196
2230
|
var s = {"container":"_GTTk7","total":"_34s2g","fees":"_W7qIA","creditCost":"_24KmE"};
|
|
@@ -2360,14 +2394,23 @@ const paymentPlanShorthandName = payment => {
|
|
|
2360
2394
|
deferred_months,
|
|
2361
2395
|
installments_count: installmentsCount
|
|
2362
2396
|
} = payment;
|
|
2363
|
-
const deferredDaysCount = deferred_days + deferred_months * 30;
|
|
2364
2397
|
|
|
2365
|
-
if (installmentsCount === 1) {
|
|
2398
|
+
if (installmentsCount === 1 && deferred_days) {
|
|
2366
2399
|
return /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2367
2400
|
id: "payment-plan-strings.day-abbreviation",
|
|
2368
|
-
defaultMessage: "J{
|
|
2401
|
+
defaultMessage: "J{deferredDays}",
|
|
2402
|
+
values: {
|
|
2403
|
+
deferredDays: `+${deferred_days}`
|
|
2404
|
+
}
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
if (installmentsCount === 1 && deferred_months) {
|
|
2409
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2410
|
+
id: "payment-plan-strings.month-abbreviation",
|
|
2411
|
+
defaultMessage: "M{deferredMonths}",
|
|
2369
2412
|
values: {
|
|
2370
|
-
|
|
2413
|
+
deferredMonths: `+${deferred_months}`
|
|
2371
2414
|
}
|
|
2372
2415
|
});
|
|
2373
2416
|
} else {
|
|
@@ -2447,6 +2490,21 @@ const paymentPlanInfoText = payment => {
|
|
|
2447
2490
|
} else if (installmentsCount > 0) {
|
|
2448
2491
|
const areInstallmentsOfSameAmount = payment_plan == null ? void 0 : payment_plan.every((installment, index) => index === 0 || installment.total_amount === payment_plan[0].total_amount);
|
|
2449
2492
|
|
|
2493
|
+
if (isP1X(payment)) {
|
|
2494
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2495
|
+
id: "payment-plan-strings.pay-now",
|
|
2496
|
+
defaultMessage: "Payez maintenant {totalAmount}",
|
|
2497
|
+
values: {
|
|
2498
|
+
totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2499
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
2500
|
+
style: "currency",
|
|
2501
|
+
currency: "EUR"
|
|
2502
|
+
}),
|
|
2503
|
+
installmentsCount
|
|
2504
|
+
}
|
|
2505
|
+
}), withNoFee(payment));
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2450
2508
|
if (areInstallmentsOfSameAmount) {
|
|
2451
2509
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2452
2510
|
id: "payment-plan-strings.multiple-installments-same-amount",
|
|
@@ -2742,7 +2800,12 @@ const Cards = ({
|
|
|
2742
2800
|
|
|
2743
2801
|
var s$7 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2744
2802
|
|
|
2745
|
-
const Info = (
|
|
2803
|
+
const Info = ({
|
|
2804
|
+
isCurrentPlanP1X
|
|
2805
|
+
}) =>
|
|
2806
|
+
/*#__PURE__*/
|
|
2807
|
+
// TODO: refactor this component into subcomponent to factorise code and be cleaner
|
|
2808
|
+
React.createElement("div", {
|
|
2746
2809
|
className: cx(s$7.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2747
2810
|
"data-testid": "modal-info-element"
|
|
2748
2811
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2751,7 +2814,13 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2751
2814
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2752
2815
|
}, "1"), /*#__PURE__*/React.createElement("div", {
|
|
2753
2816
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2754
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2817
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2818
|
+
id: "eligibility-modal.p1x-bullet-1",
|
|
2819
|
+
defaultMessage: "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
2820
|
+
values: {
|
|
2821
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2822
|
+
}
|
|
2823
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2755
2824
|
id: "eligibility-modal.bullet-1",
|
|
2756
2825
|
defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
2757
2826
|
values: {
|
|
@@ -2763,7 +2832,13 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2763
2832
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2764
2833
|
}, "2"), /*#__PURE__*/React.createElement("div", {
|
|
2765
2834
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2766
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2835
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2836
|
+
id: "eligibility-modal.p1x-bullet-2",
|
|
2837
|
+
defaultMessage: "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
2838
|
+
values: {
|
|
2839
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2840
|
+
}
|
|
2841
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2767
2842
|
id: "eligibility-modal.bullet-2",
|
|
2768
2843
|
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2769
2844
|
values: {
|
|
@@ -2775,7 +2850,13 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2775
2850
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2776
2851
|
}, "3"), /*#__PURE__*/React.createElement("div", {
|
|
2777
2852
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2778
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2853
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2854
|
+
id: "eligibility-modal.p1x-bullet-3",
|
|
2855
|
+
defaultMessage: "<strong>La validation </strong> de votre paiement est instantan\u00E9e !",
|
|
2856
|
+
values: {
|
|
2857
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2858
|
+
}
|
|
2859
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2779
2860
|
id: "eligibility-modal.bullet-3",
|
|
2780
2861
|
defaultMessage: "<strong>Gardez le contr\u00F4le</strong> en avan\u00E7ant ou reculant vos \u00E9ch\u00E9ances \u00E0 votre rythme.",
|
|
2781
2862
|
values: {
|
|
@@ -2803,7 +2884,8 @@ var s$9 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC","logo":"_xW3wt"
|
|
|
2803
2884
|
const DesktopModal = ({
|
|
2804
2885
|
children,
|
|
2805
2886
|
isSomePlanDeferred,
|
|
2806
|
-
cards
|
|
2887
|
+
cards,
|
|
2888
|
+
isCurrentPlanP1X
|
|
2807
2889
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2808
2890
|
className: cx(s$9.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
|
|
2809
2891
|
"data-testid": "modal-container"
|
|
@@ -2811,7 +2893,9 @@ const DesktopModal = ({
|
|
|
2811
2893
|
className: cx([s$9.block, s$9.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2812
2894
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2813
2895
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2814
|
-
}), /*#__PURE__*/React.createElement(Info,
|
|
2896
|
+
}), /*#__PURE__*/React.createElement(Info, {
|
|
2897
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2898
|
+
}), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2815
2899
|
cards: cards
|
|
2816
2900
|
}), /*#__PURE__*/React.createElement(AlmaLogo, {
|
|
2817
2901
|
className: s$9.logo,
|
|
@@ -2827,13 +2911,16 @@ var s$b = {"container":"_2G7Ch","logo":"_2779r"};
|
|
|
2827
2911
|
const MobileModal = ({
|
|
2828
2912
|
children,
|
|
2829
2913
|
isSomePlanDeferred,
|
|
2830
|
-
cards
|
|
2914
|
+
cards,
|
|
2915
|
+
isCurrentPlanP1X
|
|
2831
2916
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2832
2917
|
className: cx(s$b.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
|
|
2833
2918
|
"data-testid": "modal-container"
|
|
2834
2919
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2835
2920
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2836
|
-
}), children, /*#__PURE__*/React.createElement(Info,
|
|
2921
|
+
}), children, /*#__PURE__*/React.createElement(Info, {
|
|
2922
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2923
|
+
}), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2837
2924
|
cards: cards
|
|
2838
2925
|
}), /*#__PURE__*/React.createElement(AlmaLogo, {
|
|
2839
2926
|
className: s$b.logo,
|
|
@@ -2862,7 +2949,8 @@ const EligibilityModal = ({
|
|
|
2862
2949
|
isOpen: true
|
|
2863
2950
|
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2864
2951
|
isSomePlanDeferred: isSomePlanDeferred,
|
|
2865
|
-
cards: cards
|
|
2952
|
+
cards: cards,
|
|
2953
|
+
isCurrentPlanP1X: isP1X(currentPlan)
|
|
2866
2954
|
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2867
2955
|
className: s$a.loader
|
|
2868
2956
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
@@ -2972,7 +3060,9 @@ const getIndexOfActivePlan = ({
|
|
|
2972
3060
|
for (const index in suggestedPaymentPlanArray) {
|
|
2973
3061
|
const installmentsCount = suggestedPaymentPlanArray[index];
|
|
2974
3062
|
const planFound = eligibilityPlans.findIndex(plan => {
|
|
2975
|
-
return plan.installments_count === installmentsCount && plan.eligible
|
|
3063
|
+
return plan.installments_count === installmentsCount && plan.eligible && // Remove the PayLater plans from the plan to target, we will code a better solution later
|
|
3064
|
+
// To differentiate P1X from PayLater while using the `suggestedPaymentPlan` property.
|
|
3065
|
+
!plan.deferred_days && !plan.deferred_months;
|
|
2976
3066
|
});
|
|
2977
3067
|
|
|
2978
3068
|
if (planFound !== -1) {
|
|
@@ -3003,7 +3093,7 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
3003
3093
|
|
|
3004
3094
|
var s$d = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","monochrome":"_2hx83","notEligible":"_3O1bg","hideBorder":"_3_qcn","info":"_25GrF","loader":"_30j1O","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
3005
3095
|
|
|
3006
|
-
const VERY_LONG_TIME_IN_MS = 1000 * 3600
|
|
3096
|
+
const VERY_LONG_TIME_IN_MS = 1000 * 3600;
|
|
3007
3097
|
const DEFAULT_TRANSITION_TIME = 5500;
|
|
3008
3098
|
|
|
3009
3099
|
const PaymentPlanWidget = ({
|