@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.
- package/dist/raw/widgets.js +47 -17
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +47 -17
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +47 -17
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +47 -17
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +2 -0
- package/dist/types/Widgets/PaymentPlans/index.d.ts +2 -0
- package/dist/types/hooks/useFetchEligibility.d.ts +1 -1
- package/dist/types/types.d.ts +4 -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
package/dist/raw/widgets.js
CHANGED
|
@@ -1884,23 +1884,23 @@ var messagesDE = {
|
|
|
1884
1884
|
"credit-features.credit-cost-display": "{creditCost} (APR {taegPercentage})",
|
|
1885
1885
|
"credit-features.information": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
|
|
1886
1886
|
"credit-features.total-credit-cost": "Davon Kreditkosten",
|
|
1887
|
-
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong>
|
|
1887
|
+
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> beim Check-out. ",
|
|
1888
1888
|
"eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
|
|
1889
1889
|
"eligibility-modal.bullet-3": "Ihre Zahlung wird <strong>sofort</strong> bestätigt!",
|
|
1890
|
-
"eligibility-modal.no-eligibility": "Ups, die
|
|
1891
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1892
|
-
"eligibility-modal.title-normal": "
|
|
1890
|
+
"eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
|
|
1891
|
+
"eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
|
|
1892
|
+
"eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
|
|
1893
1893
|
"installments.today": "Heute",
|
|
1894
1894
|
"installments.total-amount": "Gesamtsumme",
|
|
1895
|
-
"installments.total-fees": "Davon Kosten
|
|
1895
|
+
"installments.total-fees": "Davon Kosten",
|
|
1896
1896
|
"payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
|
|
1897
|
-
"payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
|
|
1897
|
+
"payment-plan-strings.default-message": "Bezahlen Sie zinsfrei in mehreren Raten mit Alma.",
|
|
1898
1898
|
"payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
|
|
1899
1899
|
"payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
|
|
1900
1900
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1901
1901
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1902
1902
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1903
|
-
"payment-plan-strings.no-fee": "(
|
|
1903
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1904
1904
|
};
|
|
1905
1905
|
|
|
1906
1906
|
var messagesEN = {
|
|
@@ -1934,8 +1934,8 @@ var messagesES = {
|
|
|
1934
1934
|
"eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
|
|
1935
1935
|
"eligibility-modal.bullet-3": "¡La validación de tu pago es <strong>instantánea</strong> !",
|
|
1936
1936
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1937
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1938
|
-
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta
|
|
1937
|
+
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1938
|
+
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1939
1939
|
"installments.today": "Hoy",
|
|
1940
1940
|
"installments.total-amount": "Total",
|
|
1941
1941
|
"installments.total-fees": "De los cuales, costes (IVA incluido)",
|
|
@@ -1974,17 +1974,17 @@ var messagesFR = {
|
|
|
1974
1974
|
|
|
1975
1975
|
var messagesIT = {
|
|
1976
1976
|
"credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
|
|
1977
|
-
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua
|
|
1977
|
+
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
|
|
1978
1978
|
"credit-features.total-credit-cost": "Di cui commissioni",
|
|
1979
1979
|
"eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
|
|
1980
1980
|
"eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
|
|
1981
1981
|
"eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong>!",
|
|
1982
1982
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
1983
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1984
|
-
"eligibility-modal.title-normal": "
|
|
1983
|
+
"eligibility-modal.title-deferred-plan": "Paga a rate o posticipa il pagamento con Alma, senza registrazione.",
|
|
1984
|
+
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1985
1985
|
"installments.today": "Oggi",
|
|
1986
1986
|
"installments.total-amount": "Totale",
|
|
1987
|
-
"installments.total-fees": "Di cui
|
|
1987
|
+
"installments.total-fees": "Di cui commissioni",
|
|
1988
1988
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
1989
1989
|
"payment-plan-strings.default-message": "Paga a rate con Alma",
|
|
1990
1990
|
"payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
|
|
@@ -2181,7 +2181,7 @@ var filterELigibility = function filterELigibility(eligibilities, configPlans) {
|
|
|
2181
2181
|
});
|
|
2182
2182
|
};
|
|
2183
2183
|
|
|
2184
|
-
var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, plans) {
|
|
2184
|
+
var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, plans, customerBillingCountry, customerShippingCountry) {
|
|
2185
2185
|
var domain = _ref.domain,
|
|
2186
2186
|
merchantId = _ref.merchantId;
|
|
2187
2187
|
|
|
@@ -2202,9 +2202,27 @@ var useFetchEligibility = function useFetchEligibility(purchaseAmount, _ref, pla
|
|
|
2202
2202
|
});
|
|
2203
2203
|
React.useEffect(function () {
|
|
2204
2204
|
if (status === apiStatus.PENDING) {
|
|
2205
|
+
var billing_address = null;
|
|
2206
|
+
|
|
2207
|
+
if (customerBillingCountry) {
|
|
2208
|
+
billing_address = {
|
|
2209
|
+
country: customerBillingCountry
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
var shipping_address = null;
|
|
2214
|
+
|
|
2215
|
+
if (customerShippingCountry) {
|
|
2216
|
+
shipping_address = {
|
|
2217
|
+
country: customerShippingCountry
|
|
2218
|
+
};
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2205
2221
|
fetchFromApi(domain + '/v2/payments/eligibility', {
|
|
2206
2222
|
purchase_amount: purchaseAmount,
|
|
2207
|
-
queries: configInstallments
|
|
2223
|
+
queries: configInstallments,
|
|
2224
|
+
billing_address: billing_address,
|
|
2225
|
+
shipping_address: shipping_address
|
|
2208
2226
|
}, {
|
|
2209
2227
|
Authorization: "Alma-Merchant-Auth " + merchantId
|
|
2210
2228
|
}).then(function (res) {
|
|
@@ -2948,10 +2966,12 @@ var ModalContainer = function ModalContainer(_ref) {
|
|
|
2948
2966
|
var purchaseAmount = _ref.purchaseAmount,
|
|
2949
2967
|
apiData = _ref.apiData,
|
|
2950
2968
|
configPlans = _ref.configPlans,
|
|
2969
|
+
customerBillingCountry = _ref.customerBillingCountry,
|
|
2970
|
+
customerShippingCountry = _ref.customerShippingCountry,
|
|
2951
2971
|
onClose = _ref.onClose,
|
|
2952
2972
|
cards = _ref.cards;
|
|
2953
2973
|
|
|
2954
|
-
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
2974
|
+
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry),
|
|
2955
2975
|
eligibilityPlans = _useFetchEligibility[0],
|
|
2956
2976
|
status = _useFetchEligibility[1];
|
|
2957
2977
|
|
|
@@ -3084,11 +3104,13 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
3084
3104
|
purchaseAmount = _ref.purchaseAmount,
|
|
3085
3105
|
suggestedPaymentPlan = _ref.suggestedPaymentPlan,
|
|
3086
3106
|
cards = _ref.cards,
|
|
3107
|
+
customerBillingCountry = _ref.customerBillingCountry,
|
|
3108
|
+
customerShippingCountry = _ref.customerShippingCountry,
|
|
3087
3109
|
transitionDelay = _ref.transitionDelay,
|
|
3088
3110
|
_ref$hideBorder = _ref.hideBorder,
|
|
3089
3111
|
hideBorder = _ref$hideBorder === void 0 ? false : _ref$hideBorder;
|
|
3090
3112
|
|
|
3091
|
-
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
3113
|
+
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry),
|
|
3092
3114
|
eligibilityPlans = _useFetchEligibility[0],
|
|
3093
3115
|
status = _useFetchEligibility[1];
|
|
3094
3116
|
|
|
@@ -3247,6 +3269,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3247
3269
|
_options$monochrome = options.monochrome,
|
|
3248
3270
|
monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
|
|
3249
3271
|
suggestedPaymentPlan = options.suggestedPaymentPlan,
|
|
3272
|
+
customerBillingCountry = options.customerBillingCountry,
|
|
3273
|
+
customerShippingCountry = options.customerShippingCountry,
|
|
3250
3274
|
_options$locale = options.locale,
|
|
3251
3275
|
locale = _options$locale === void 0 ? Locale.en : _options$locale,
|
|
3252
3276
|
cards = options.cards;
|
|
@@ -3262,6 +3286,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3262
3286
|
purchaseAmount: purchaseAmount,
|
|
3263
3287
|
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3264
3288
|
cards: cards,
|
|
3289
|
+
customerBillingCountry: customerBillingCountry,
|
|
3290
|
+
customerShippingCountry: customerShippingCountry,
|
|
3265
3291
|
transitionDelay: transitionDelay,
|
|
3266
3292
|
hideBorder: hideBorder
|
|
3267
3293
|
})), document.querySelector(container));
|
|
@@ -3275,6 +3301,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3275
3301
|
_plans = options.plans,
|
|
3276
3302
|
_options$locale2 = options.locale,
|
|
3277
3303
|
_locale = _options$locale2 === void 0 ? Locale.en : _options$locale2,
|
|
3304
|
+
_customerBillingCountry = options.customerBillingCountry,
|
|
3305
|
+
_customerShippingCountry = options.customerShippingCountry,
|
|
3278
3306
|
_cards = options.cards;
|
|
3279
3307
|
|
|
3280
3308
|
var close = function close() {
|
|
@@ -3288,6 +3316,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
3288
3316
|
purchaseAmount: _purchaseAmount,
|
|
3289
3317
|
apiData: _this.apiData,
|
|
3290
3318
|
configPlans: _plans,
|
|
3319
|
+
customerBillingCountry: _customerBillingCountry,
|
|
3320
|
+
customerShippingCountry: _customerShippingCountry,
|
|
3291
3321
|
onClose: close,
|
|
3292
3322
|
cards: _cards
|
|
3293
3323
|
})), document.querySelector(_container));
|