@alma/widgets 3.1.1 → 3.2.0
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/README.md +3 -1
- package/dist/raw/widgets.js +161 -80
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +161 -80
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +115 -40
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +161 -80
- 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/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 -249
- package/dist/types/test/fixtures.d.ts +0 -77
- package/dist/types/test/index.d.ts +0 -7
|
@@ -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
|
|
|
@@ -1862,9 +1863,12 @@ var messagesDE = {
|
|
|
1862
1863
|
"credit-features.information": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
|
|
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
|
-
"eligibility-modal.bullet-2": "
|
|
1866
|
-
"eligibility-modal.bullet-3": "
|
|
1866
|
+
"eligibility-modal.bullet-2": "Lassen Sie sich führen und bestätigen Sie Ihre Zahlung in <strong>2 Minuten.</strong>",
|
|
1867
|
+
"eligibility-modal.bullet-3": "<strong>Behalten Sie die Kontrolle</strong> , indem Sie Ihre Fristen in 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> bei der Bezahlung.",
|
|
1870
|
+
"eligibility-modal.p1x-bullet-2": "Füllen Sie die Informationen auf Ihrer <strong>Kreditkarte aus.</strong>",
|
|
1871
|
+
"eligibility-modal.p1x-bullet-3": "<strong>Die Bestätigung </strong> Ihrer Zahlung erfolgt sofort!",
|
|
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",
|
|
@@ -1877,7 +1881,8 @@ var messagesDE = {
|
|
|
1877
1881
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1878
1882
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1879
1883
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1880
|
-
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1884
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)",
|
|
1885
|
+
"payment-plan-strings.pay-now": "Bezahlen Sie jetzt {totalAmount}"
|
|
1881
1886
|
};
|
|
1882
1887
|
|
|
1883
1888
|
var messagesEN = {
|
|
@@ -1885,9 +1890,12 @@ var messagesEN = {
|
|
|
1885
1890
|
"credit-features.information": "A loan commits you and must be repaid. Check your ability to repay before committing yourself.",
|
|
1886
1891
|
"credit-features.total-credit-cost": "Of which cost of credit",
|
|
1887
1892
|
"eligibility-modal.bullet-1": "Choose <strong>Alma</strong> at checkout.",
|
|
1888
|
-
"eligibility-modal.bullet-2": "
|
|
1889
|
-
"eligibility-modal.bullet-3": "
|
|
1893
|
+
"eligibility-modal.bullet-2": "Let us guide you and validate your payment in <strong>2 minutes.</strong>",
|
|
1894
|
+
"eligibility-modal.bullet-3": "<strong>Stay in control</strong> by moving your deadlines forward or backward at your own pace.",
|
|
1890
1895
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1896
|
+
"eligibility-modal.p1x-bullet-1": "Choose <strong>Alma - 1X</strong> at checkout.",
|
|
1897
|
+
"eligibility-modal.p1x-bullet-2": "Fill in your <strong>credit card information.</strong>",
|
|
1898
|
+
"eligibility-modal.p1x-bullet-3": "<strong>The validation </strong> of your payment is instantaneous!",
|
|
1891
1899
|
"eligibility-modal.title-deferred-plan": "Pay in installments or later by credit card with Alma.",
|
|
1892
1900
|
"eligibility-modal.title-normal": "Pay in installments by credit card with Alma.",
|
|
1893
1901
|
"installments.today": "Today",
|
|
@@ -1900,7 +1908,8 @@ var messagesEN = {
|
|
|
1900
1908
|
"payment-plan-strings.ineligible-lower-than-min": "From {minAmount}",
|
|
1901
1909
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1902
1910
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1903
|
-
"payment-plan-strings.no-fee": "(free of charge)"
|
|
1911
|
+
"payment-plan-strings.no-fee": "(free of charge)",
|
|
1912
|
+
"payment-plan-strings.pay-now": "Pay now {totalAmount}"
|
|
1904
1913
|
};
|
|
1905
1914
|
|
|
1906
1915
|
var messagesES = {
|
|
@@ -1908,9 +1917,12 @@ var messagesES = {
|
|
|
1908
1917
|
"credit-features.information": "Un préstamo te compromete y debe ser devuelto. Comprueba tu capacidad financiera antes de comprometerte.",
|
|
1909
1918
|
"credit-features.total-credit-cost": "Coste de crédito (incl. en el total)",
|
|
1910
1919
|
"eligibility-modal.bullet-1": "Elige <strong>Alma</strong> como método de pago.",
|
|
1911
|
-
"eligibility-modal.bullet-2": "
|
|
1912
|
-
"eligibility-modal.bullet-3": "
|
|
1920
|
+
"eligibility-modal.bullet-2": "Déjese guiar y valide su pago en <strong>2 minutos.</strong>",
|
|
1921
|
+
"eligibility-modal.bullet-3": "<strong>Mantenga el control</strong> adelantando o retrasando los plazos a su propio ritmo.",
|
|
1913
1922
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1923
|
+
"eligibility-modal.p1x-bullet-1": "Elija <strong>Alma - 1X</strong> en la caja.",
|
|
1924
|
+
"eligibility-modal.p1x-bullet-2": "Introduzca los datos de su tarjeta de crédito en <strong>.</strong>",
|
|
1925
|
+
"eligibility-modal.p1x-bullet-3": "<strong>¡La validación </strong> de su pago es instantánea!",
|
|
1914
1926
|
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1915
1927
|
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1916
1928
|
"installments.today": "Hoy",
|
|
@@ -1923,7 +1935,8 @@ var messagesES = {
|
|
|
1923
1935
|
"payment-plan-strings.ineligible-lower-than-min": "Desde {minAmount}",
|
|
1924
1936
|
"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
1937
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} plazos de {totalAmount}",
|
|
1926
|
-
"payment-plan-strings.no-fee": "(sin intereses)"
|
|
1938
|
+
"payment-plan-strings.no-fee": "(sin intereses)",
|
|
1939
|
+
"payment-plan-strings.pay-now": "Pague ahora {totalAmount}"
|
|
1927
1940
|
};
|
|
1928
1941
|
|
|
1929
1942
|
var messagesFR = {
|
|
@@ -1931,9 +1944,12 @@ var messagesFR = {
|
|
|
1931
1944
|
"credit-features.information": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
|
|
1932
1945
|
"credit-features.total-credit-cost": "Dont coût du crédit",
|
|
1933
1946
|
"eligibility-modal.bullet-1": "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
1934
|
-
"eligibility-modal.bullet-2": "
|
|
1935
|
-
"eligibility-modal.bullet-3": "
|
|
1947
|
+
"eligibility-modal.bullet-2": "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
1948
|
+
"eligibility-modal.bullet-3": "<strong>Gardez le contrôle</strong> en avançant ou reculant vos échéances à votre rythme.",
|
|
1936
1949
|
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1950
|
+
"eligibility-modal.p1x-bullet-1": "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
1951
|
+
"eligibility-modal.p1x-bullet-2": "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
1952
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La validation </strong> de votre paiement est instantanée !",
|
|
1937
1953
|
"eligibility-modal.title-deferred-plan": "Payez en plusieurs fois ou plus tard par carte bancaire avec Alma.",
|
|
1938
1954
|
"eligibility-modal.title-normal": "Payez en plusieurs fois par carte bancaire avec Alma.",
|
|
1939
1955
|
"installments.today": "Aujourd'hui",
|
|
@@ -1946,7 +1962,8 @@ var messagesFR = {
|
|
|
1946
1962
|
"payment-plan-strings.ineligible-lower-than-min": "À partir de {minAmount}",
|
|
1947
1963
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1948
1964
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1949
|
-
"payment-plan-strings.no-fee": "(sans frais)"
|
|
1965
|
+
"payment-plan-strings.no-fee": "(sans frais)",
|
|
1966
|
+
"payment-plan-strings.pay-now": "Payez maintenant {totalAmount}"
|
|
1950
1967
|
};
|
|
1951
1968
|
|
|
1952
1969
|
var messagesIT = {
|
|
@@ -1954,9 +1971,12 @@ var messagesIT = {
|
|
|
1954
1971
|
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
|
|
1955
1972
|
"credit-features.total-credit-cost": "Di cui commissioni",
|
|
1956
1973
|
"eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
|
|
1957
|
-
"eligibility-modal.bullet-2": "
|
|
1958
|
-
"eligibility-modal.bullet-3": "
|
|
1974
|
+
"eligibility-modal.bullet-2": "Lasciatevi guidare e convalidate il pagamento in <strong>2 minuti.</strong>",
|
|
1975
|
+
"eligibility-modal.bullet-3": "<strong>Mantenete il controllo</strong> spostando le scadenze in avanti o indietro al vostro ritmo.",
|
|
1959
1976
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
1977
|
+
"eligibility-modal.p1x-bullet-1": "Scegliere <strong>Alma - 1X</strong> alla cassa.",
|
|
1978
|
+
"eligibility-modal.p1x-bullet-2": "Compilare i dati della carta di credito <strong>.</strong>",
|
|
1979
|
+
"eligibility-modal.p1x-bullet-3": "<strong>La convalida </strong> del vostro pagamento è istantanea!",
|
|
1960
1980
|
"eligibility-modal.title-deferred-plan": "Paga a rate o posticipa il pagamento con Alma, senza registrazione.",
|
|
1961
1981
|
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1962
1982
|
"installments.today": "Oggi",
|
|
@@ -1969,7 +1989,8 @@ var messagesIT = {
|
|
|
1969
1989
|
"payment-plan-strings.ineligible-lower-than-min": "Pagamento rateale disponibile a partire da {minAmount}",
|
|
1970
1990
|
"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
1991
|
"payment-plan-strings.multiple-installments-same-amount": "In {installmentsCount} rate mensili di {totalAmount}",
|
|
1972
|
-
"payment-plan-strings.no-fee": "(senza interessi)"
|
|
1992
|
+
"payment-plan-strings.no-fee": "(senza interessi)",
|
|
1993
|
+
"payment-plan-strings.pay-now": "Paga ora {totalAmount}"
|
|
1973
1994
|
};
|
|
1974
1995
|
|
|
1975
1996
|
var messagesNL = {
|
|
@@ -1977,9 +1998,12 @@ var messagesNL = {
|
|
|
1977
1998
|
"credit-features.information": "Een lening bindt je en moet worden terugbetaald. Ga na of u kunt terugbetalen voordat u zich vastlegt.",
|
|
1978
1999
|
"credit-features.total-credit-cost": "Waarvan kosten van krediet",
|
|
1979
2000
|
"eligibility-modal.bullet-1": "Kies <strong>Alma</strong> bij het afrekenen.",
|
|
1980
|
-
"eligibility-modal.bullet-2": "
|
|
1981
|
-
"eligibility-modal.bullet-3": "
|
|
2001
|
+
"eligibility-modal.bullet-2": "Laat ons u begeleiden en uw betaling valideren in <strong>2 minuten.</strong>",
|
|
2002
|
+
"eligibility-modal.bullet-3": "<strong>Houd de controle op</strong> door uw deadlines in uw eigen tempo vooruit of achteruit te schuiven.",
|
|
1982
2003
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
2004
|
+
"eligibility-modal.p1x-bullet-1": "Kies <strong>Alma - 1X</strong> bij het afrekenen.",
|
|
2005
|
+
"eligibility-modal.p1x-bullet-2": "Vul uw <strong>creditcardgegevens in.</strong>",
|
|
2006
|
+
"eligibility-modal.p1x-bullet-3": "<strong>De validatie </strong> van uw betaling is onmiddellijk!",
|
|
1983
2007
|
"eligibility-modal.title-deferred-plan": "Betaal in termijnen of later per creditcard met Alma.",
|
|
1984
2008
|
"eligibility-modal.title-normal": "Betaal in termijnen met een creditcard bij Alma.",
|
|
1985
2009
|
"installments.today": "Tegenwoordig",
|
|
@@ -1992,7 +2016,8 @@ var messagesNL = {
|
|
|
1992
2016
|
"payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
|
|
1993
2017
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1994
2018
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1995
|
-
"payment-plan-strings.no-fee": "(zonder kosten)"
|
|
2019
|
+
"payment-plan-strings.no-fee": "(zonder kosten)",
|
|
2020
|
+
"payment-plan-strings.pay-now": "Betaal nu {totalAmount}"
|
|
1996
2021
|
};
|
|
1997
2022
|
|
|
1998
2023
|
var messagesPT = {
|
|
@@ -2000,9 +2025,12 @@ var messagesPT = {
|
|
|
2000
2025
|
"credit-features.information": "Um crédito é um compromisso e deve ser reembolsado. Verifique a sua capacidade de pagar antes de se comprometer.",
|
|
2001
2026
|
"credit-features.total-credit-cost": "Incluindo custo do crédito",
|
|
2002
2027
|
"eligibility-modal.bullet-1": "Escolha a <strong>Alma</strong> no checkout.",
|
|
2003
|
-
"eligibility-modal.bullet-2": "
|
|
2004
|
-
"eligibility-modal.bullet-3": "
|
|
2028
|
+
"eligibility-modal.bullet-2": "Deixe-nos guiá-lo e validar o seu pagamento em <strong>2 minutos.</strong>",
|
|
2029
|
+
"eligibility-modal.bullet-3": "<strong>Mantenha-se em controlo</strong> avançando ou recuando os seus prazos ao seu próprio ritmo.",
|
|
2005
2030
|
"eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
|
|
2031
|
+
"eligibility-modal.p1x-bullet-1": "Escolher <strong>Alma - 1X</strong> no checkout.",
|
|
2032
|
+
"eligibility-modal.p1x-bullet-2": "Preencha as informações do seu <strong>cartão de crédito.</strong>",
|
|
2033
|
+
"eligibility-modal.p1x-bullet-3": "<strong>A validação </strong> do seu pagamento é instantânea!",
|
|
2006
2034
|
"eligibility-modal.title-deferred-plan": "Pagar em prestações ou mais tarde por cartão de crédito com Alma.",
|
|
2007
2035
|
"eligibility-modal.title-normal": "Pagar em prestações por cartão de crédito com Alma.",
|
|
2008
2036
|
"installments.today": "Hoje",
|
|
@@ -2015,7 +2043,8 @@ var messagesPT = {
|
|
|
2015
2043
|
"payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
|
|
2016
2044
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
2017
2045
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
2018
|
-
"payment-plan-strings.no-fee": "(sem encargos)"
|
|
2046
|
+
"payment-plan-strings.no-fee": "(sem encargos)",
|
|
2047
|
+
"payment-plan-strings.pay-now": "Pague agora {totalAmount}"
|
|
2019
2048
|
};
|
|
2020
2049
|
|
|
2021
2050
|
const getTranslationsByLocale = locale => {
|
|
@@ -2125,15 +2154,13 @@ const getPaymentPlanBoundaries = (plan, configPlan) => {
|
|
|
2125
2154
|
};
|
|
2126
2155
|
|
|
2127
2156
|
const filterELigibility = (eligibilities, configPlans) => {
|
|
2128
|
-
//
|
|
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
|
-
|
|
2157
|
+
// If no configPlans was provided, return eligibility response
|
|
2131
2158
|
if (!configPlans) {
|
|
2132
|
-
return
|
|
2159
|
+
return eligibilities;
|
|
2133
2160
|
} // Else check if the plan is eligible regarding the related configPlan
|
|
2134
2161
|
|
|
2135
2162
|
|
|
2136
|
-
return
|
|
2163
|
+
return eligibilities.map(plan => {
|
|
2137
2164
|
const eligibilityDeferredDays = (plan.deferred_months ? plan.deferred_months : 0) * 30 + (plan.deferred_days ? plan.deferred_days : 0); // find the related configPlan
|
|
2138
2165
|
|
|
2139
2166
|
const relatedConfigPlan = configPlans.find(configPlan => {
|
|
@@ -2362,7 +2389,8 @@ const paymentPlanShorthandName = payment => {
|
|
|
2362
2389
|
} = payment;
|
|
2363
2390
|
const deferredDaysCount = deferred_days + deferred_months * 30;
|
|
2364
2391
|
|
|
2365
|
-
if (installmentsCount === 1) {
|
|
2392
|
+
if (installmentsCount === 1 && deferredDaysCount > 0) {
|
|
2393
|
+
// For now there is no distinction between deferred days and deferred months, it will be J+ anyway
|
|
2366
2394
|
return /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2367
2395
|
id: "payment-plan-strings.day-abbreviation",
|
|
2368
2396
|
defaultMessage: "J{numberOfDeferredDays}",
|
|
@@ -2447,6 +2475,21 @@ const paymentPlanInfoText = payment => {
|
|
|
2447
2475
|
} else if (installmentsCount > 0) {
|
|
2448
2476
|
const areInstallmentsOfSameAmount = payment_plan == null ? void 0 : payment_plan.every((installment, index) => index === 0 || installment.total_amount === payment_plan[0].total_amount);
|
|
2449
2477
|
|
|
2478
|
+
if (isP1X(payment)) {
|
|
2479
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2480
|
+
id: "payment-plan-strings.pay-now",
|
|
2481
|
+
defaultMessage: "Payez maintenant {totalAmount}",
|
|
2482
|
+
values: {
|
|
2483
|
+
totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
2484
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
2485
|
+
style: "currency",
|
|
2486
|
+
currency: "EUR"
|
|
2487
|
+
}),
|
|
2488
|
+
installmentsCount
|
|
2489
|
+
}
|
|
2490
|
+
}), withNoFee(payment));
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2450
2493
|
if (areInstallmentsOfSameAmount) {
|
|
2451
2494
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2452
2495
|
id: "payment-plan-strings.multiple-installments-same-amount",
|
|
@@ -2742,7 +2785,12 @@ const Cards = ({
|
|
|
2742
2785
|
|
|
2743
2786
|
var s$7 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2744
2787
|
|
|
2745
|
-
const Info = (
|
|
2788
|
+
const Info = ({
|
|
2789
|
+
isCurrentPlanP1X
|
|
2790
|
+
}) =>
|
|
2791
|
+
/*#__PURE__*/
|
|
2792
|
+
// TODO: refactor this component into subcomponent to factorise code and be cleaner
|
|
2793
|
+
React.createElement("div", {
|
|
2746
2794
|
className: cx(s$7.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2747
2795
|
"data-testid": "modal-info-element"
|
|
2748
2796
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2751,7 +2799,13 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2751
2799
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2752
2800
|
}, "1"), /*#__PURE__*/React.createElement("div", {
|
|
2753
2801
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2754
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2802
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2803
|
+
id: "eligibility-modal.p1x-bullet-1",
|
|
2804
|
+
defaultMessage: "Choisissez <strong>Alma - 1X</strong> au moment du paiement.",
|
|
2805
|
+
values: {
|
|
2806
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2807
|
+
}
|
|
2808
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2755
2809
|
id: "eligibility-modal.bullet-1",
|
|
2756
2810
|
defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
2757
2811
|
values: {
|
|
@@ -2763,9 +2817,15 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2763
2817
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2764
2818
|
}, "2"), /*#__PURE__*/React.createElement("div", {
|
|
2765
2819
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2766
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2820
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2821
|
+
id: "eligibility-modal.p1x-bullet-2",
|
|
2822
|
+
defaultMessage: "Renseignez les informations de votre <strong>carte bancaire.</strong>",
|
|
2823
|
+
values: {
|
|
2824
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2825
|
+
}
|
|
2826
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2767
2827
|
id: "eligibility-modal.bullet-2",
|
|
2768
|
-
defaultMessage: "
|
|
2828
|
+
defaultMessage: "Laissez-vous guider et validez votre paiement en <strong>2 minutes.</strong>",
|
|
2769
2829
|
values: {
|
|
2770
2830
|
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2771
2831
|
}
|
|
@@ -2775,9 +2835,15 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2775
2835
|
className: cx(s$7.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
|
|
2776
2836
|
}, "3"), /*#__PURE__*/React.createElement("div", {
|
|
2777
2837
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2778
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2838
|
+
}, isCurrentPlanP1X ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2839
|
+
id: "eligibility-modal.p1x-bullet-3",
|
|
2840
|
+
defaultMessage: "<strong>La validation </strong> de votre paiement est instantan\u00E9e !",
|
|
2841
|
+
values: {
|
|
2842
|
+
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2843
|
+
}
|
|
2844
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2779
2845
|
id: "eligibility-modal.bullet-3",
|
|
2780
|
-
defaultMessage: "
|
|
2846
|
+
defaultMessage: "<strong>Gardez le contr\u00F4le</strong> en avan\u00E7ant ou reculant vos \u00E9ch\u00E9ances \u00E0 votre rythme.",
|
|
2781
2847
|
values: {
|
|
2782
2848
|
strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
|
|
2783
2849
|
}
|
|
@@ -2803,7 +2869,8 @@ var s$9 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC","logo":"_xW3wt"
|
|
|
2803
2869
|
const DesktopModal = ({
|
|
2804
2870
|
children,
|
|
2805
2871
|
isSomePlanDeferred,
|
|
2806
|
-
cards
|
|
2872
|
+
cards,
|
|
2873
|
+
isCurrentPlanP1X
|
|
2807
2874
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2808
2875
|
className: cx(s$9.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
|
|
2809
2876
|
"data-testid": "modal-container"
|
|
@@ -2811,7 +2878,9 @@ const DesktopModal = ({
|
|
|
2811
2878
|
className: cx([s$9.block, s$9.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2812
2879
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2813
2880
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2814
|
-
}), /*#__PURE__*/React.createElement(Info,
|
|
2881
|
+
}), /*#__PURE__*/React.createElement(Info, {
|
|
2882
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2883
|
+
}), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2815
2884
|
cards: cards
|
|
2816
2885
|
}), /*#__PURE__*/React.createElement(AlmaLogo, {
|
|
2817
2886
|
className: s$9.logo,
|
|
@@ -2827,13 +2896,16 @@ var s$b = {"container":"_2G7Ch","logo":"_2779r"};
|
|
|
2827
2896
|
const MobileModal = ({
|
|
2828
2897
|
children,
|
|
2829
2898
|
isSomePlanDeferred,
|
|
2830
|
-
cards
|
|
2899
|
+
cards,
|
|
2900
|
+
isCurrentPlanP1X
|
|
2831
2901
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2832
2902
|
className: cx(s$b.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
|
|
2833
2903
|
"data-testid": "modal-container"
|
|
2834
2904
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2835
2905
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2836
|
-
}), children, /*#__PURE__*/React.createElement(Info,
|
|
2906
|
+
}), children, /*#__PURE__*/React.createElement(Info, {
|
|
2907
|
+
isCurrentPlanP1X: isCurrentPlanP1X
|
|
2908
|
+
}), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2837
2909
|
cards: cards
|
|
2838
2910
|
}), /*#__PURE__*/React.createElement(AlmaLogo, {
|
|
2839
2911
|
className: s$b.logo,
|
|
@@ -2862,7 +2934,8 @@ const EligibilityModal = ({
|
|
|
2862
2934
|
isOpen: true
|
|
2863
2935
|
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2864
2936
|
isSomePlanDeferred: isSomePlanDeferred,
|
|
2865
|
-
cards: cards
|
|
2937
|
+
cards: cards,
|
|
2938
|
+
isCurrentPlanP1X: isP1X(currentPlan)
|
|
2866
2939
|
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2867
2940
|
className: s$a.loader
|
|
2868
2941
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
@@ -2972,7 +3045,9 @@ const getIndexOfActivePlan = ({
|
|
|
2972
3045
|
for (const index in suggestedPaymentPlanArray) {
|
|
2973
3046
|
const installmentsCount = suggestedPaymentPlanArray[index];
|
|
2974
3047
|
const planFound = eligibilityPlans.findIndex(plan => {
|
|
2975
|
-
return plan.installments_count === installmentsCount && plan.eligible
|
|
3048
|
+
return plan.installments_count === installmentsCount && plan.eligible && // Remove the PayLater plans from the plan to target, we will code a better solution later
|
|
3049
|
+
// To differentiate P1X from PayLater while using the `suggestedPaymentPlan` property.
|
|
3050
|
+
!plan.deferred_days && !plan.deferred_months;
|
|
2976
3051
|
});
|
|
2977
3052
|
|
|
2978
3053
|
if (planFound !== -1) {
|
|
@@ -3003,7 +3078,7 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
3003
3078
|
|
|
3004
3079
|
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
3080
|
|
|
3006
|
-
const VERY_LONG_TIME_IN_MS = 1000 * 3600
|
|
3081
|
+
const VERY_LONG_TIME_IN_MS = 1000 * 3600;
|
|
3007
3082
|
const DEFAULT_TRANSITION_TIME = 5500;
|
|
3008
3083
|
|
|
3009
3084
|
const PaymentPlanWidget = ({
|