@alma/widgets 3.0.5 → 3.1.1

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.
@@ -1881,23 +1881,23 @@ var messagesDE = {
1881
1881
  "credit-features.credit-cost-display": "{creditCost} (APR {taegPercentage})",
1882
1882
  "credit-features.information": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1883
1883
  "credit-features.total-credit-cost": "Davon Kreditkosten",
1884
- "eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> bei der Bezahlung.",
1884
+ "eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> beim Check-out. ",
1885
1885
  "eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
1886
1886
  "eligibility-modal.bullet-3": "Ihre Zahlung wird <strong>sofort</strong> bestätigt!",
1887
- "eligibility-modal.no-eligibility": "Ups, die Simulation hat anscheinend nicht funktioniert.",
1888
- "eligibility-modal.title-deferred-plan": "Bezahlen Sie mit Alma in Raten oder später per Kreditkarte.",
1889
- "eligibility-modal.title-normal": "Bezahlen Sie mit Alma in mehreren Raten per Kreditkarte.",
1887
+ "eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
1888
+ "eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
1889
+ "eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
1890
1890
  "installments.today": "Heute",
1891
1891
  "installments.total-amount": "Gesamtsumme",
1892
- "installments.total-fees": "Davon Kosten (inkl. MwSt.)",
1892
+ "installments.total-fees": "Davon Kosten",
1893
1893
  "payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
1894
- "payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
1894
+ "payment-plan-strings.default-message": "Bezahlen Sie zinsfrei in mehreren Raten mit Alma.",
1895
1895
  "payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
1896
1896
  "payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
1897
1897
  "payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
1898
1898
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1899
1899
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
1900
- "payment-plan-strings.no-fee": "(gebührenfrei)"
1900
+ "payment-plan-strings.no-fee": "(0% Finanzierung)"
1901
1901
  };
1902
1902
 
1903
1903
  var messagesEN = {
@@ -1931,8 +1931,8 @@ var messagesES = {
1931
1931
  "eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
1932
1932
  "eligibility-modal.bullet-3": "¡La validación de tu pago es <strong>instantánea</strong> !",
1933
1933
  "eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
1934
- "eligibility-modal.title-deferred-plan": "Pague a plazos o posteriormente con tarjeta de crédito con Alma.",
1935
- "eligibility-modal.title-normal": "Pagar a plazos con tarjeta de crédito con Alma.",
1934
+ "eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
1935
+ "eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
1936
1936
  "installments.today": "Hoy",
1937
1937
  "installments.total-amount": "Total",
1938
1938
  "installments.total-fees": "De los cuales, costes (IVA incluido)",
@@ -1971,17 +1971,17 @@ var messagesFR = {
1971
1971
 
1972
1972
  var messagesIT = {
1973
1973
  "credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
1974
- "credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua capacità di rimborso prima di impegnarti.",
1974
+ "credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
1975
1975
  "credit-features.total-credit-cost": "Di cui commissioni",
1976
1976
  "eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
1977
1977
  "eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
1978
1978
  "eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong>!",
1979
1979
  "eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
1980
- "eligibility-modal.title-deferred-plan": "Pagate a rate o in seguito con carta di credito con Alma.",
1981
- "eligibility-modal.title-normal": "Pagamenti rateali con carta di credito con Alma.",
1980
+ "eligibility-modal.title-deferred-plan": "Paga a rate o posticipa il pagamento con Alma, senza registrazione.",
1981
+ "eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
1982
1982
  "installments.today": "Oggi",
1983
1983
  "installments.total-amount": "Totale",
1984
- "installments.total-fees": "Di cui costi (IVA inclusa)",
1984
+ "installments.total-fees": "Di cui commissioni",
1985
1985
  "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
1986
1986
  "payment-plan-strings.default-message": "Paga a rate con Alma",
1987
1987
  "payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
@@ -2178,7 +2178,7 @@ var filterELigibility = function filterELigibility(eligibilities, configPlans) {
2178
2178
  });
2179
2179
  };
2180
2180
 
2181
- var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, plans) {
2181
+ var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, plans, customerBillingCountry, customerShippingCountry) {
2182
2182
  var domain = _ref.domain,
2183
2183
  merchantId = _ref.merchantId;
2184
2184
 
@@ -2199,9 +2199,27 @@ var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, pla
2199
2199
  });
2200
2200
  useEffect(function () {
2201
2201
  if (status === apiStatus.PENDING) {
2202
+ var billing_address = null;
2203
+
2204
+ if (customerBillingCountry) {
2205
+ billing_address = {
2206
+ country: customerBillingCountry
2207
+ };
2208
+ }
2209
+
2210
+ var shipping_address = null;
2211
+
2212
+ if (customerShippingCountry) {
2213
+ shipping_address = {
2214
+ country: customerShippingCountry
2215
+ };
2216
+ }
2217
+
2202
2218
  fetchFromApi(domain + '/v2/payments/eligibility', {
2203
2219
  purchase_amount: purchaseAmount,
2204
- queries: configInstallments
2220
+ queries: configInstallments,
2221
+ billing_address: billing_address,
2222
+ shipping_address: shipping_address
2205
2223
  }, {
2206
2224
  Authorization: "Alma-Merchant-Auth " + merchantId
2207
2225
  }).then(function (res) {
@@ -2945,10 +2963,12 @@ var ModalContainer = function ModalContainer(_ref) {
2945
2963
  var purchaseAmount = _ref.purchaseAmount,
2946
2964
  apiData = _ref.apiData,
2947
2965
  configPlans = _ref.configPlans,
2966
+ customerBillingCountry = _ref.customerBillingCountry,
2967
+ customerShippingCountry = _ref.customerShippingCountry,
2948
2968
  onClose = _ref.onClose,
2949
2969
  cards = _ref.cards;
2950
2970
 
2951
- var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
2971
+ var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry),
2952
2972
  eligibilityPlans = _useFetchEligibility[0],
2953
2973
  status = _useFetchEligibility[1];
2954
2974
 
@@ -3081,11 +3101,13 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
3081
3101
  purchaseAmount = _ref.purchaseAmount,
3082
3102
  suggestedPaymentPlan = _ref.suggestedPaymentPlan,
3083
3103
  cards = _ref.cards,
3104
+ customerBillingCountry = _ref.customerBillingCountry,
3105
+ customerShippingCountry = _ref.customerShippingCountry,
3084
3106
  transitionDelay = _ref.transitionDelay,
3085
3107
  _ref$hideBorder = _ref.hideBorder,
3086
3108
  hideBorder = _ref$hideBorder === void 0 ? false : _ref$hideBorder;
3087
3109
 
3088
- var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
3110
+ var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry),
3089
3111
  eligibilityPlans = _useFetchEligibility[0],
3090
3112
  status = _useFetchEligibility[1];
3091
3113
 
@@ -3244,6 +3266,8 @@ var WidgetsController = /*#__PURE__*/function () {
3244
3266
  _options$monochrome = options.monochrome,
3245
3267
  monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
3246
3268
  suggestedPaymentPlan = options.suggestedPaymentPlan,
3269
+ customerBillingCountry = options.customerBillingCountry,
3270
+ customerShippingCountry = options.customerShippingCountry,
3247
3271
  _options$locale = options.locale,
3248
3272
  locale = _options$locale === void 0 ? Locale.en : _options$locale,
3249
3273
  cards = options.cards;
@@ -3259,6 +3283,8 @@ var WidgetsController = /*#__PURE__*/function () {
3259
3283
  purchaseAmount: purchaseAmount,
3260
3284
  suggestedPaymentPlan: suggestedPaymentPlan,
3261
3285
  cards: cards,
3286
+ customerBillingCountry: customerBillingCountry,
3287
+ customerShippingCountry: customerShippingCountry,
3262
3288
  transitionDelay: transitionDelay,
3263
3289
  hideBorder: hideBorder
3264
3290
  })), document.querySelector(container));
@@ -3272,6 +3298,8 @@ var WidgetsController = /*#__PURE__*/function () {
3272
3298
  _plans = options.plans,
3273
3299
  _options$locale2 = options.locale,
3274
3300
  _locale = _options$locale2 === void 0 ? Locale.en : _options$locale2,
3301
+ _customerBillingCountry = options.customerBillingCountry,
3302
+ _customerShippingCountry = options.customerShippingCountry,
3275
3303
  _cards = options.cards;
3276
3304
 
3277
3305
  var close = function close() {
@@ -3285,6 +3313,8 @@ var WidgetsController = /*#__PURE__*/function () {
3285
3313
  purchaseAmount: _purchaseAmount,
3286
3314
  apiData: _this.apiData,
3287
3315
  configPlans: _plans,
3316
+ customerBillingCountry: _customerBillingCountry,
3317
+ customerShippingCountry: _customerShippingCountry,
3288
3318
  onClose: close,
3289
3319
  cards: _cards
3290
3320
  })), document.querySelector(_container));