@alma/widgets 3.2.2 → 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.
@@ -1874,11 +1874,12 @@ var messagesDE = {
1874
1874
  "installments.today": "Heute",
1875
1875
  "installments.total-amount": "Gesamtsumme",
1876
1876
  "installments.total-fees": "Davon Kosten",
1877
- "payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
1877
+ "payment-plan-strings.day-abbreviation": "T{deferredDays}",
1878
1878
  "payment-plan-strings.default-message": "Bezahlen Sie zinsfrei in mehreren Raten mit Alma.",
1879
1879
  "payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
1880
1880
  "payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
1881
1881
  "payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
1882
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
1882
1883
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1883
1884
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
1884
1885
  "payment-plan-strings.no-fee": "(0% Finanzierung)",
@@ -1901,11 +1902,12 @@ var messagesEN = {
1901
1902
  "installments.today": "Today",
1902
1903
  "installments.total-amount": "Total",
1903
1904
  "installments.total-fees": "Of which costs (incl. VAT)",
1904
- "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
1905
+ "payment-plan-strings.day-abbreviation": "D{deferredDays}",
1905
1906
  "payment-plan-strings.default-message": "Pay in installments with Alma",
1906
- "payment-plan-strings.deferred": "{totalAmount} to be paid on {dueDate}",
1907
+ "payment-plan-strings.deferred": "{totalAmount} to pay the {dueDate}",
1907
1908
  "payment-plan-strings.ineligible-greater-than-max": "Until {maxAmount}",
1908
1909
  "payment-plan-strings.ineligible-lower-than-min": "From {minAmount}",
1910
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
1909
1911
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} then {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1910
1912
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
1911
1913
  "payment-plan-strings.no-fee": "(free of charge)",
@@ -1928,11 +1930,12 @@ var messagesES = {
1928
1930
  "installments.today": "Hoy",
1929
1931
  "installments.total-amount": "Total",
1930
1932
  "installments.total-fees": "De los cuales, costes (IVA incluido)",
1931
- "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
1933
+ "payment-plan-strings.day-abbreviation": "D{deferredDays}",
1932
1934
  "payment-plan-strings.default-message": "Pagar a plazos con Alma",
1933
1935
  "payment-plan-strings.deferred": "{totalAmount} a pagar el {dueDate}",
1934
1936
  "payment-plan-strings.ineligible-greater-than-max": "Hasta {maxAmount}",
1935
1937
  "payment-plan-strings.ineligible-lower-than-min": "Desde {minAmount}",
1938
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
1936
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}}}",
1937
1940
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} plazos de {totalAmount}",
1938
1941
  "payment-plan-strings.no-fee": "(sin intereses)",
@@ -1955,11 +1958,12 @@ var messagesFR = {
1955
1958
  "installments.today": "Aujourd'hui",
1956
1959
  "installments.total-amount": "Total",
1957
1960
  "installments.total-fees": "Dont frais (TTC)",
1958
- "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
1961
+ "payment-plan-strings.day-abbreviation": "J{deferredDays}",
1959
1962
  "payment-plan-strings.default-message": "Payez en plusieurs fois avec Alma",
1960
1963
  "payment-plan-strings.deferred": "{totalAmount} à payer le {dueDate}",
1961
1964
  "payment-plan-strings.ineligible-greater-than-max": "Jusqu'à {maxAmount}",
1962
1965
  "payment-plan-strings.ineligible-lower-than-min": "À partir de {minAmount}",
1966
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
1963
1967
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1964
1968
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
1965
1969
  "payment-plan-strings.no-fee": "(sans frais)",
@@ -1982,11 +1986,12 @@ var messagesIT = {
1982
1986
  "installments.today": "Oggi",
1983
1987
  "installments.total-amount": "Totale",
1984
1988
  "installments.total-fees": "Di cui commissioni",
1985
- "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
1989
+ "payment-plan-strings.day-abbreviation": "G{deferredDays}",
1986
1990
  "payment-plan-strings.default-message": "Paga a rate con Alma, senza registrazione.",
1987
1991
  "payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
1988
1992
  "payment-plan-strings.ineligible-greater-than-max": "Disponibile fino a {maxAmount}",
1989
1993
  "payment-plan-strings.ineligible-lower-than-min": "Pagamento rateale disponibile a partire da {minAmount}",
1994
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
1990
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}}}",
1991
1996
  "payment-plan-strings.multiple-installments-same-amount": "In {installmentsCount} rate mensili di {totalAmount}",
1992
1997
  "payment-plan-strings.no-fee": "(senza interessi)",
@@ -2009,11 +2014,12 @@ var messagesNL = {
2009
2014
  "installments.today": "Tegenwoordig",
2010
2015
  "installments.total-amount": "Totaal",
2011
2016
  "installments.total-fees": "Waarvan kosten (incl. BTW)",
2012
- "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2017
+ "payment-plan-strings.day-abbreviation": "D{deferredDays}",
2013
2018
  "payment-plan-strings.default-message": "Betaal in termijnen met Alma",
2014
2019
  "payment-plan-strings.deferred": "{totalAmount} te betalen op {dueDate}",
2015
2020
  "payment-plan-strings.ineligible-greater-than-max": "Tot {maxAmount}",
2016
2021
  "payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
2022
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
2017
2023
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2018
2024
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2019
2025
  "payment-plan-strings.no-fee": "(zonder kosten)",
@@ -2036,11 +2042,12 @@ var messagesPT = {
2036
2042
  "installments.today": "Hoje",
2037
2043
  "installments.total-amount": "Total",
2038
2044
  "installments.total-fees": "Dos quais custos (incl. IVA)",
2039
- "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2045
+ "payment-plan-strings.day-abbreviation": "D{deferredDays}",
2040
2046
  "payment-plan-strings.default-message": "Pague em prestações através da Alma",
2041
2047
  "payment-plan-strings.deferred": "{totalAmount} a pagar em {dueDate}",
2042
2048
  "payment-plan-strings.ineligible-greater-than-max": "Até {maxAmount}",
2043
2049
  "payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
2050
+ "payment-plan-strings.month-abbreviation": "M{deferredMonths}",
2044
2051
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2045
2052
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2046
2053
  "payment-plan-strings.no-fee": "(sem encargos)",
@@ -2153,7 +2160,7 @@ const getPaymentPlanBoundaries = (plan, configPlan) => {
2153
2160
  return configPlan != null ? configPlan : {};
2154
2161
  };
2155
2162
 
2156
- const filterELigibility = (eligibilities, configPlans) => {
2163
+ const filterEligibility = (eligibilities, configPlans) => {
2157
2164
  // Remove P1X if no configuration is provided
2158
2165
  if (!configPlans) {
2159
2166
  return eligibilities.filter(plan => !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0));
@@ -2217,7 +2224,7 @@ const useFetchEligibility = (purchaseAmount, {
2217
2224
  });
2218
2225
  }
2219
2226
  }, [status]);
2220
- return [filterELigibility(eligibility, plans), status];
2227
+ return [filterEligibility(eligibility, plans), status];
2221
2228
  };
2222
2229
 
2223
2230
  var s = {"container":"_GTTk7","total":"_34s2g","fees":"_W7qIA","creditCost":"_24KmE"};
@@ -2387,15 +2394,23 @@ const paymentPlanShorthandName = payment => {
2387
2394
  deferred_months,
2388
2395
  installments_count: installmentsCount
2389
2396
  } = payment;
2390
- const deferredDaysCount = deferred_days + deferred_months * 30;
2391
2397
 
2392
- if (installmentsCount === 1 && deferredDaysCount > 0) {
2393
- // For now there is no distinction between deferred days and deferred months, it will be J+ anyway
2398
+ if (installmentsCount === 1 && deferred_days) {
2394
2399
  return /*#__PURE__*/React.createElement(FormattedMessage, {
2395
2400
  id: "payment-plan-strings.day-abbreviation",
2396
- defaultMessage: "J{numberOfDeferredDays}",
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}",
2397
2412
  values: {
2398
- numberOfDeferredDays: deferredDaysCount > 0 ? `+${deferredDaysCount}` : ''
2413
+ deferredMonths: `+${deferred_months}`
2399
2414
  }
2400
2415
  });
2401
2416
  } else {