@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
|
@@ -1861,23 +1861,23 @@ var messagesDE = {
|
|
|
1861
1861
|
"credit-features.credit-cost-display": "{creditCost} (APR {taegPercentage})",
|
|
1862
1862
|
"credit-features.information": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
|
|
1863
1863
|
"credit-features.total-credit-cost": "Davon Kreditkosten",
|
|
1864
|
-
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong>
|
|
1864
|
+
"eligibility-modal.bullet-1": "Wählen Sie <strong>Alma</strong> beim Check-out. ",
|
|
1865
1865
|
"eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
|
|
1866
1866
|
"eligibility-modal.bullet-3": "Ihre Zahlung wird <strong>sofort</strong> bestätigt!",
|
|
1867
|
-
"eligibility-modal.no-eligibility": "Ups, die
|
|
1868
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1869
|
-
"eligibility-modal.title-normal": "
|
|
1867
|
+
"eligibility-modal.no-eligibility": "Ups, die Prüfung hat anscheinend nicht funktioniert.",
|
|
1868
|
+
"eligibility-modal.title-deferred-plan": "Zahlen Sie mit Alma in Raten oder später.",
|
|
1869
|
+
"eligibility-modal.title-normal": "Zahlen Sie mit Alma in mehreren Raten.",
|
|
1870
1870
|
"installments.today": "Heute",
|
|
1871
1871
|
"installments.total-amount": "Gesamtsumme",
|
|
1872
|
-
"installments.total-fees": "Davon Kosten
|
|
1872
|
+
"installments.total-fees": "Davon Kosten",
|
|
1873
1873
|
"payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
|
|
1874
|
-
"payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
|
|
1874
|
+
"payment-plan-strings.default-message": "Bezahlen Sie zinsfrei in mehreren Raten mit Alma.",
|
|
1875
1875
|
"payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
|
|
1876
1876
|
"payment-plan-strings.ineligible-greater-than-max": "Bis zu {maxAmount}",
|
|
1877
1877
|
"payment-plan-strings.ineligible-lower-than-min": "Ab {minAmount}",
|
|
1878
1878
|
"payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dann {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1879
1879
|
"payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
|
|
1880
|
-
"payment-plan-strings.no-fee": "(
|
|
1880
|
+
"payment-plan-strings.no-fee": "(0% Finanzierung)"
|
|
1881
1881
|
};
|
|
1882
1882
|
|
|
1883
1883
|
var messagesEN = {
|
|
@@ -1911,8 +1911,8 @@ var messagesES = {
|
|
|
1911
1911
|
"eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
|
|
1912
1912
|
"eligibility-modal.bullet-3": "¡La validación de tu pago es <strong>instantánea</strong> !",
|
|
1913
1913
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1914
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1915
|
-
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta
|
|
1914
|
+
"eligibility-modal.title-deferred-plan": "Paga a plazos o posteriormente con tarjeta bancaria con Alma.",
|
|
1915
|
+
"eligibility-modal.title-normal": "Pagar a plazos con tarjeta bancaria con Alma.",
|
|
1916
1916
|
"installments.today": "Hoy",
|
|
1917
1917
|
"installments.total-amount": "Total",
|
|
1918
1918
|
"installments.total-fees": "De los cuales, costes (IVA incluido)",
|
|
@@ -1951,17 +1951,17 @@ var messagesFR = {
|
|
|
1951
1951
|
|
|
1952
1952
|
var messagesIT = {
|
|
1953
1953
|
"credit-features.credit-cost-display": "{creditCost} (TAEG {taegPercentage})",
|
|
1954
|
-
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua
|
|
1954
|
+
"credit-features.information": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua disponibilità finanziaria prima di impegnarti.",
|
|
1955
1955
|
"credit-features.total-credit-cost": "Di cui commissioni",
|
|
1956
1956
|
"eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
|
|
1957
1957
|
"eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
|
|
1958
1958
|
"eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong>!",
|
|
1959
1959
|
"eligibility-modal.no-eligibility": "Ops, sembra che qualcosa non abbia funzionato.",
|
|
1960
|
-
"eligibility-modal.title-deferred-plan": "
|
|
1961
|
-
"eligibility-modal.title-normal": "
|
|
1960
|
+
"eligibility-modal.title-deferred-plan": "Paga a rate o posticipa il pagamento con Alma, senza registrazione.",
|
|
1961
|
+
"eligibility-modal.title-normal": "Paga a rate con Alma, senza registrazione.",
|
|
1962
1962
|
"installments.today": "Oggi",
|
|
1963
1963
|
"installments.total-amount": "Totale",
|
|
1964
|
-
"installments.total-fees": "Di cui
|
|
1964
|
+
"installments.total-fees": "Di cui commissioni",
|
|
1965
1965
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
1966
1966
|
"payment-plan-strings.default-message": "Paga a rate con Alma",
|
|
1967
1967
|
"payment-plan-strings.deferred": "{totalAmount} da pagare il {dueDate}",
|
|
@@ -2149,7 +2149,7 @@ const filterELigibility = (eligibilities, configPlans) => {
|
|
|
2149
2149
|
const useFetchEligibility = (purchaseAmount, {
|
|
2150
2150
|
domain,
|
|
2151
2151
|
merchantId
|
|
2152
|
-
}, plans) => {
|
|
2152
|
+
}, plans, customerBillingCountry, customerShippingCountry) => {
|
|
2153
2153
|
const [eligibility, setEligibility] = useState([]);
|
|
2154
2154
|
const [status, setStatus] = useState(apiStatus.PENDING);
|
|
2155
2155
|
const configInstallments = plans == null ? void 0 : plans.map(plan => ({
|
|
@@ -2159,9 +2159,27 @@ const useFetchEligibility = (purchaseAmount, {
|
|
|
2159
2159
|
}));
|
|
2160
2160
|
useEffect(() => {
|
|
2161
2161
|
if (status === apiStatus.PENDING) {
|
|
2162
|
+
let billing_address = null;
|
|
2163
|
+
|
|
2164
|
+
if (customerBillingCountry) {
|
|
2165
|
+
billing_address = {
|
|
2166
|
+
country: customerBillingCountry
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
let shipping_address = null;
|
|
2171
|
+
|
|
2172
|
+
if (customerShippingCountry) {
|
|
2173
|
+
shipping_address = {
|
|
2174
|
+
country: customerShippingCountry
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2162
2178
|
fetchFromApi(domain + '/v2/payments/eligibility', {
|
|
2163
2179
|
purchase_amount: purchaseAmount,
|
|
2164
|
-
queries: configInstallments
|
|
2180
|
+
queries: configInstallments,
|
|
2181
|
+
billing_address,
|
|
2182
|
+
shipping_address
|
|
2165
2183
|
}, {
|
|
2166
2184
|
Authorization: `Alma-Merchant-Auth ${merchantId}`
|
|
2167
2185
|
}).then(res => {
|
|
@@ -2875,10 +2893,12 @@ const ModalContainer = ({
|
|
|
2875
2893
|
purchaseAmount,
|
|
2876
2894
|
apiData,
|
|
2877
2895
|
configPlans,
|
|
2896
|
+
customerBillingCountry,
|
|
2897
|
+
customerShippingCountry,
|
|
2878
2898
|
onClose,
|
|
2879
2899
|
cards
|
|
2880
2900
|
}) => {
|
|
2881
|
-
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
|
|
2901
|
+
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry);
|
|
2882
2902
|
return /*#__PURE__*/React.createElement(EligibilityModal, {
|
|
2883
2903
|
initialPlanIndex: 0,
|
|
2884
2904
|
onClose: onClose,
|
|
@@ -2994,10 +3014,12 @@ const PaymentPlanWidget = ({
|
|
|
2994
3014
|
purchaseAmount,
|
|
2995
3015
|
suggestedPaymentPlan,
|
|
2996
3016
|
cards,
|
|
3017
|
+
customerBillingCountry,
|
|
3018
|
+
customerShippingCountry,
|
|
2997
3019
|
transitionDelay,
|
|
2998
3020
|
hideBorder: _hideBorder = false
|
|
2999
3021
|
}) => {
|
|
3000
|
-
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
|
|
3022
|
+
const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans, customerBillingCountry, customerShippingCountry);
|
|
3001
3023
|
const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
|
|
3002
3024
|
const activePlanIndex = getIndexOfActivePlan({
|
|
3003
3025
|
eligibilityPlans,
|
|
@@ -3140,6 +3162,8 @@ class WidgetsController {
|
|
|
3140
3162
|
hideBorder = false,
|
|
3141
3163
|
monochrome = true,
|
|
3142
3164
|
suggestedPaymentPlan,
|
|
3165
|
+
customerBillingCountry,
|
|
3166
|
+
customerShippingCountry,
|
|
3143
3167
|
locale = Locale.en,
|
|
3144
3168
|
cards
|
|
3145
3169
|
} = options;
|
|
@@ -3155,6 +3179,8 @@ class WidgetsController {
|
|
|
3155
3179
|
purchaseAmount: purchaseAmount,
|
|
3156
3180
|
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3157
3181
|
cards: cards,
|
|
3182
|
+
customerBillingCountry: customerBillingCountry,
|
|
3183
|
+
customerShippingCountry: customerShippingCountry,
|
|
3158
3184
|
transitionDelay: transitionDelay,
|
|
3159
3185
|
hideBorder: hideBorder
|
|
3160
3186
|
})), document.querySelector(container));
|
|
@@ -3168,6 +3194,8 @@ class WidgetsController {
|
|
|
3168
3194
|
purchaseAmount,
|
|
3169
3195
|
plans,
|
|
3170
3196
|
locale = Locale.en,
|
|
3197
|
+
customerBillingCountry,
|
|
3198
|
+
customerShippingCountry,
|
|
3171
3199
|
cards
|
|
3172
3200
|
} = options;
|
|
3173
3201
|
|
|
@@ -3180,6 +3208,8 @@ class WidgetsController {
|
|
|
3180
3208
|
purchaseAmount: purchaseAmount,
|
|
3181
3209
|
apiData: this.apiData,
|
|
3182
3210
|
configPlans: plans,
|
|
3211
|
+
customerBillingCountry: customerBillingCountry,
|
|
3212
|
+
customerShippingCountry: customerShippingCountry,
|
|
3183
3213
|
onClose: close,
|
|
3184
3214
|
cards: cards
|
|
3185
3215
|
})), document.querySelector(container));
|