@odus/checkout 1.8.2 → 1.9.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/checkout.es.js +74 -58
- package/dist/components/checkout/form/Form.d.ts +10 -1
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts +6 -2
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
- package/dist/components/checkout/form/PaymentMethods.d.ts +5 -1
- package/dist/components/checkout/form/PaymentMethods.d.ts.map +1 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts +9 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts.map +1 -1
- package/dist/core/api/CheckoutAPI.service.d.ts.map +1 -1
- package/dist/elements/ApplePayElement.d.ts +5 -1
- package/dist/elements/ApplePayElement.d.ts.map +1 -1
- package/dist/elements/OdusElements.d.ts +26 -0
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements/PhoneElement.d.ts.map +1 -1
- package/dist/elements.es.js +240 -198
- package/dist/services/checkout/Checkout.service.d.ts +12 -0
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/services/checkout/CheckoutForm.service.d.ts +1 -1
- package/dist/services/checkout/CheckoutForm.service.d.ts.map +1 -1
- package/dist/shared.js +516 -511
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +5 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/dist/utils/helpers/readApiMessage.util.d.ts +7 -0
- package/dist/utils/helpers/readApiMessage.util.d.ts.map +1 -0
- package/package.json +8 -4
package/dist/checkout.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, E as r, F as i, G as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m,
|
|
1
|
+
import { A as e, B as t, C as n, E as r, F as i, G as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, Q as h, S as g, T as ee, V as te, X as _, Y as v, Z as y, a as b, b as x, c as S, d as C, g as w, h as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, q as N, r as ne, s as re, t as ie, u as P, w as F, x as I, y as L, z as R } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/utils/helpers/hasAddressConfiguration.util.ts
|
|
3
3
|
function z(e) {
|
|
4
4
|
if (!e) return !1;
|
|
@@ -34,7 +34,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
34
34
|
let e = document.createElement("h3");
|
|
35
35
|
e.className = "address-section-title", e.textContent = t, e.style.color = n.styles.textColor, e.style.fontFamily = `"${n.styles.fontFamily}", sans-serif`, e.style.fontSize = `${n.styles.fontSize}px`, e.style.fontWeight = "normal", this.getElement().appendChild(e);
|
|
36
36
|
}
|
|
37
|
-
this.fieldsContainer = document.createElement("div"), this.fieldsContainer.className = "address-fields", this.grouped || this.fieldsContainer.classList.add("address-fields--ungrouped"), this.getElement().appendChild(this.fieldsContainer), this.createFields(n, r, i, a, o), this.grouped && (this.groupMessage = new
|
|
37
|
+
this.fieldsContainer = document.createElement("div"), this.fieldsContainer.className = "address-fields", this.grouped || this.fieldsContainer.classList.add("address-fields--ungrouped"), this.getElement().appendChild(this.fieldsContainer), this.createFields(n, r, i, a, o), this.grouped && (this.groupMessage = new k({
|
|
38
38
|
text: "",
|
|
39
39
|
visible: !1
|
|
40
40
|
}), this.fieldsContainer.appendChild(this.groupMessage.getElement()));
|
|
@@ -124,7 +124,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
124
124
|
return t.className = `address-row address-row-${e.length === 1 ? "single" : "double"}`, t;
|
|
125
125
|
}
|
|
126
126
|
createInput(e, t, n, r, i, a, o, s) {
|
|
127
|
-
let c = `${this.type}Address.${e}`, l = new
|
|
127
|
+
let c = `${this.type}Address.${e}`, l = new C({
|
|
128
128
|
name: c,
|
|
129
129
|
error: !1,
|
|
130
130
|
errorMsg: void 0,
|
|
@@ -166,7 +166,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
166
166
|
}), l;
|
|
167
167
|
}
|
|
168
168
|
createCountrySelect(e, t, n, r, i, a) {
|
|
169
|
-
let o = `${this.type}Address.country`, s =
|
|
169
|
+
let o = `${this.type}Address.country`, s = w(i, this.locale), c = new P({
|
|
170
170
|
name: o,
|
|
171
171
|
error: !1,
|
|
172
172
|
errorMsg: void 0,
|
|
@@ -212,7 +212,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
212
212
|
if (i && a) {
|
|
213
213
|
let t = this.inputs.get("state");
|
|
214
214
|
if (t instanceof P) {
|
|
215
|
-
let n = e === "CA" ? "CA" : "US", r =
|
|
215
|
+
let n = e === "CA" ? "CA" : "US", r = T(n), i = n === "CA" ? this.translationFunc("address.chooseProvince") : this.translationFunc("address.chooseState");
|
|
216
216
|
t.setOptions(r, i);
|
|
217
217
|
}
|
|
218
218
|
this.clearStateValue();
|
|
@@ -250,7 +250,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
250
250
|
}));
|
|
251
251
|
}
|
|
252
252
|
createStateSelect(e, t, n, r, i, a) {
|
|
253
|
-
let o = `${this.type}Address.state`, s = i === "CA" ? "CA" : "US", c =
|
|
253
|
+
let o = `${this.type}Address.state`, s = i === "CA" ? "CA" : "US", c = T(s), l = s === "CA" ? this.translationFunc("address.chooseProvince") : this.translationFunc("address.chooseState"), u = new P({
|
|
254
254
|
name: o,
|
|
255
255
|
error: !1,
|
|
256
256
|
errorMsg: void 0,
|
|
@@ -374,7 +374,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
374
374
|
vgsHelperText = null;
|
|
375
375
|
wrapperElement;
|
|
376
376
|
_vgsFieldsReady = !1;
|
|
377
|
-
_fieldHeight =
|
|
377
|
+
_fieldHeight = x(L, 14);
|
|
378
378
|
_borderRadius = 0;
|
|
379
379
|
constructor(e) {
|
|
380
380
|
let { value: t, onChange: n, onBlur: r, errorMsg: i, checkoutProfile: a, translationFunc: o, autocomplete: s = "cc-name", isVgsMode: c = !1 } = e;
|
|
@@ -382,16 +382,16 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
382
382
|
}
|
|
383
383
|
buildVgsLayout(e, t) {
|
|
384
384
|
let n = e.styles.borderRadius;
|
|
385
|
-
this._borderRadius = n, this._fieldHeight =
|
|
385
|
+
this._borderRadius = n, this._fieldHeight = x(L, e.styles.fontSize);
|
|
386
386
|
let r = document.createElement("div");
|
|
387
387
|
r.style.marginBottom = "4px";
|
|
388
388
|
let i = document.createElement("label");
|
|
389
389
|
i.className = "input-label", i.textContent = t("cardholderNameLabel"), i.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, i.style.fontSize = `${e.styles.fontSize}px`, r.appendChild(i), this.wrapperElement.appendChild(r), this.vgsWrapper = document.createElement("div"), this.vgsWrapper.className = "vgs-wrap", this.vgsWrapper.style.position = "relative", this.vgsWrapper.style.borderRadius = `${n}px`, this.vgsWrapper.style.height = this._fieldHeight, this.vgsWrapper.style.width = "100%", this.vgsWrapper.style.overflow = "hidden";
|
|
390
390
|
let a = document.createElement("div");
|
|
391
|
-
a.className = "vgs-field-skeleton", this.vgsWrapper.appendChild(a), this.vgsContainer = document.createElement("div"), this.vgsContainer.id = `vgs-cc-name-${Date.now()}`, this.vgsContainer.style.position = "relative", this.vgsContainer.style.zIndex = "1", this.vgsContainer.style.width = "100%", this.vgsContainer.style.height = "100%", this.vgsWrapper.appendChild(this.vgsContainer), this.wrapperElement.appendChild(this.vgsWrapper), this.vgsHelperText = new
|
|
391
|
+
a.className = "vgs-field-skeleton", this.vgsWrapper.appendChild(a), this.vgsContainer = document.createElement("div"), this.vgsContainer.id = `vgs-cc-name-${Date.now()}`, this.vgsContainer.style.position = "relative", this.vgsContainer.style.zIndex = "1", this.vgsContainer.style.width = "100%", this.vgsContainer.style.height = "100%", this.vgsWrapper.appendChild(this.vgsContainer), this.wrapperElement.appendChild(this.vgsWrapper), this.vgsHelperText = new k({ visible: !1 }), this.wrapperElement.appendChild(this.vgsHelperText.getElement());
|
|
392
392
|
}
|
|
393
393
|
buildNativeLayout(e, t, n, r, i, a, o) {
|
|
394
|
-
this.input = new
|
|
394
|
+
this.input = new C({
|
|
395
395
|
name: "name",
|
|
396
396
|
label: a("cardholderNameLabel"),
|
|
397
397
|
error: !1,
|
|
@@ -418,9 +418,9 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
418
418
|
}
|
|
419
419
|
handleVgsStateChange(e, t) {
|
|
420
420
|
if (!this.isVgsMode || !this.vgsWrapper) return;
|
|
421
|
-
let n = e[
|
|
421
|
+
let n = e[S.CARDHOLDER]?.isFocused;
|
|
422
422
|
if (this._vgsFieldsReady && (this.vgsWrapper.style.boxShadow = n ? "0 0 0 1px rgba(50, 151, 211, 0.7), 0 1px 1px 0 rgba(0, 0, 0, 0.07), 0 0 0 4px rgba(50, 151, 211, 0.3)" : "0 0 0 1px #e0e0e0, 0 2px 4px 0 rgba(0,0,0,0.07), 0 1px 1.5px 0 rgba(0,0,0,0.05)"), !t || !this.vgsHelperText) return;
|
|
423
|
-
let r = t[
|
|
423
|
+
let r = t[S.CARDHOLDER];
|
|
424
424
|
r ? (this.vgsHelperText.setText(r), this.vgsHelperText.toggleVisibility(!0)) : this.vgsHelperText.toggleVisibility(!1);
|
|
425
425
|
}
|
|
426
426
|
setFieldHeight(e) {
|
|
@@ -470,11 +470,11 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
470
470
|
this.appendChild(this.createPaymentMethodSkeleton()), this.appendChild(this.createPaymentSeparatorSkeleton());
|
|
471
471
|
}
|
|
472
472
|
createPaymentMethodSkeleton() {
|
|
473
|
-
let e =
|
|
473
|
+
let e = M.createDiv(["skeleton-field"]), t = M.createDiv(["skeleton", "skeleton-payment-method"]);
|
|
474
474
|
return e.appendChild(t), e;
|
|
475
475
|
}
|
|
476
476
|
createPaymentSeparatorSkeleton() {
|
|
477
|
-
let e =
|
|
477
|
+
let e = M.createDiv(["payment-separator_container"]), t = M.createDiv(["payment-separator__line"]), n = M.createDiv(["skeleton", "skeleton-separator-text"]), r = M.createDiv(["payment-separator__line"]);
|
|
478
478
|
return e.appendChild(t), e.appendChild(n), e.appendChild(r), e;
|
|
479
479
|
}
|
|
480
480
|
}, G = class extends I {
|
|
@@ -503,7 +503,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
let f = Object.entries(t.additionalPaymentMethods).filter(([e, t]) => {
|
|
506
|
-
let n = t.enabled, r = !a || a[e] === !0, i =
|
|
506
|
+
let n = t.enabled, r = !a || a[e] === !0, i = b(t.countries, d);
|
|
507
507
|
return n && r && i;
|
|
508
508
|
}).sort((e, t) => e[1].order - t[1].order);
|
|
509
509
|
if (f.length === 0) {
|
|
@@ -513,7 +513,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
513
513
|
for (let [e] of f) switch (e) {
|
|
514
514
|
case "paypal":
|
|
515
515
|
if (r) {
|
|
516
|
-
let e = new
|
|
516
|
+
let e = new A({
|
|
517
517
|
checkoutProfile: t,
|
|
518
518
|
formData: n,
|
|
519
519
|
onSubmit: r
|
|
@@ -523,7 +523,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
523
523
|
break;
|
|
524
524
|
case "applePay":
|
|
525
525
|
if (i && s && c) {
|
|
526
|
-
let e = t.appearance?.additionalPaymentMethods?.applePay, r = new
|
|
526
|
+
let e = t.appearance?.additionalPaymentMethods?.applePay, r = new ne({
|
|
527
527
|
checkoutProfile: t,
|
|
528
528
|
formData: n,
|
|
529
529
|
onSubmit: i,
|
|
@@ -665,7 +665,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
665
665
|
createEmailField(e, t, n, r) {
|
|
666
666
|
try {
|
|
667
667
|
let i = e.layout.billingFields && Object.values(e.layout.billingFields).some((e) => e?.enabled) || e.layout.shippingFields && Object.values(e.layout.shippingFields).some((e) => e?.enabled);
|
|
668
|
-
this.emailField = new
|
|
668
|
+
this.emailField = new j({
|
|
669
669
|
value: t.email,
|
|
670
670
|
onChange: this.onChange,
|
|
671
671
|
onBlur: this.onBlur,
|
|
@@ -708,7 +708,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
708
708
|
this.cardSectionSkeleton = this.buildCardSkeleton(e), this.formElement.appendChild(this.cardSectionSkeleton);
|
|
709
709
|
return;
|
|
710
710
|
}
|
|
711
|
-
if (this.cardSection = new
|
|
711
|
+
if (this.cardSection = new re({
|
|
712
712
|
checkoutProfile: e,
|
|
713
713
|
cardNumber: t.cardNumber,
|
|
714
714
|
cardNumberError: n.cardNumber,
|
|
@@ -886,7 +886,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
886
886
|
this.vgsService = e;
|
|
887
887
|
}
|
|
888
888
|
buildCardSkeleton(e) {
|
|
889
|
-
let t = e.styles.borderRadius, n =
|
|
889
|
+
let t = e.styles.borderRadius, n = x(L, e.styles.fontSize), r = document.createElement("div"), i = document.createElement("div");
|
|
890
890
|
i.style.marginBottom = "4px";
|
|
891
891
|
let a = document.createElement("label");
|
|
892
892
|
a.className = "input-label", a.textContent = this.translationFunc("cardInformation"), a.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, a.style.fontSize = `${e.styles.fontSize}px`, i.appendChild(a), r.appendChild(i);
|
|
@@ -915,7 +915,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
915
915
|
let i = document.createElement("label");
|
|
916
916
|
i.className = "input-label", i.textContent = this.translationFunc("cardholderNameLabel"), i.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, i.style.fontSize = `${e.styles.fontSize}px`, r.appendChild(i), n.appendChild(r);
|
|
917
917
|
let a = document.createElement("div");
|
|
918
|
-
return a.style.position = "relative", a.style.borderRadius = `${t}px`, a.style.height =
|
|
918
|
+
return a.style.position = "relative", a.style.borderRadius = `${t}px`, a.style.height = x(L, e.styles.fontSize), a.style.width = "100%", a.style.overflow = "hidden", a.style.background = "#fff", a.appendChild(this.createSkeletonDiv()), n.appendChild(a), n.appendChild(this.createHelperTextSpacer("form-helper-text-anchor")), n;
|
|
919
919
|
}
|
|
920
920
|
async mountVgsFields(e) {
|
|
921
921
|
if (!this.vgsService || !this.cardSection) return;
|
|
@@ -1031,7 +1031,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
1031
1031
|
if (!e.isLoading) {
|
|
1032
1032
|
if (e.checkoutProfile) try {
|
|
1033
1033
|
if (e.checkoutProfile.styles?.fontFamily) try {
|
|
1034
|
-
let { cleanup: t } =
|
|
1034
|
+
let { cleanup: t } = ee({ fontFamily: e.checkoutProfile.styles.fontFamily });
|
|
1035
1035
|
this.fontCleanup = t, this.formElement.style.fontFamily = e.checkoutProfile.styles.fontFamily;
|
|
1036
1036
|
} catch (e) {
|
|
1037
1037
|
console.error("Error loading Google Font:", e);
|
|
@@ -1068,7 +1068,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
1068
1068
|
if (!r?.isTouched || r.isFocused || r.isValid) continue;
|
|
1069
1069
|
let i = r.errors?.[0];
|
|
1070
1070
|
if (!i) continue;
|
|
1071
|
-
let a =
|
|
1071
|
+
let a = O(n, i.code);
|
|
1072
1072
|
a && (t[n] = e(a));
|
|
1073
1073
|
}
|
|
1074
1074
|
return t;
|
|
@@ -1083,7 +1083,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
1083
1083
|
titleElement;
|
|
1084
1084
|
constructor(e = {}) {
|
|
1085
1085
|
super("div", ["blur-bg"]);
|
|
1086
|
-
let t =
|
|
1086
|
+
let t = M.createDiv(["loader"]);
|
|
1087
1087
|
this.titleElement = new I("h3", ["title"]), this.titleElement.setText(e.text || ""), this.appendChild(t), this.appendChild(this.titleElement);
|
|
1088
1088
|
}
|
|
1089
1089
|
setText(e) {
|
|
@@ -1136,7 +1136,7 @@ var V = /* @__PURE__ */ new Set(["US", "CA"]), H = class extends I {
|
|
|
1136
1136
|
this.formSkeleton &&= (this.formSkeleton.getElement().remove(), void 0);
|
|
1137
1137
|
}
|
|
1138
1138
|
setErrorMessage(e) {
|
|
1139
|
-
this.alert &&= (this.alert.getElement().remove(), void 0), this.alert = new
|
|
1139
|
+
this.alert &&= (this.alert.getElement().remove(), void 0), this.alert = new ie({ message: e }), this.formElement.insertBefore(this.alert.getElement(), this.formElement.firstChild);
|
|
1140
1140
|
}
|
|
1141
1141
|
clearErrorMessage() {
|
|
1142
1142
|
this.alert &&= (this.alert.getElement().remove(), void 0);
|
|
@@ -1160,7 +1160,7 @@ var Z = (e) => ({
|
|
|
1160
1160
|
formManager = s();
|
|
1161
1161
|
checkoutProfile;
|
|
1162
1162
|
translation = r();
|
|
1163
|
-
focusManager = new
|
|
1163
|
+
focusManager = new g();
|
|
1164
1164
|
componentManager;
|
|
1165
1165
|
eventHandler;
|
|
1166
1166
|
stateCoordinator;
|
|
@@ -1236,10 +1236,13 @@ var Z = (e) => ({
|
|
|
1236
1236
|
initializeForm() {
|
|
1237
1237
|
this.uiManager.setLoadingState(!0), this.options.errorMsg && this.uiManager.setErrorMessage(this.options.errorMsg), this.vgsService && this.vgsService.init(this.options.environment).then((e) => {
|
|
1238
1238
|
this.vgsService?.createForm(e, (e) => this.handleVgsStateChange(e));
|
|
1239
|
-
}).catch(() => {
|
|
1240
|
-
|
|
1239
|
+
}).catch((e) => {
|
|
1240
|
+
console.error("Failed to load VGS Collect:", e), this.fallBackToNativeCardFields();
|
|
1241
1241
|
});
|
|
1242
1242
|
}
|
|
1243
|
+
fallBackToNativeCardFields() {
|
|
1244
|
+
this.vgsService = void 0, this.vgsJwt = void 0, this.componentManager.setVgsService(void 0), this.stateCoordinator.setVgsMode(!1), this.checkoutProfile.getState().checkoutProfile && this.renderFormComponents();
|
|
1245
|
+
}
|
|
1243
1246
|
renderFormComponents() {
|
|
1244
1247
|
let e = this.checkoutProfile.getState();
|
|
1245
1248
|
if (!e.checkoutProfile) {
|
|
@@ -1357,12 +1360,13 @@ var Z = (e) => ({
|
|
|
1357
1360
|
async handleApplePaySubmit(e) {
|
|
1358
1361
|
this.stateCoordinator.setSubmitting(!0), this.updateFormUI(), this.options.onLoadingStateChange?.(!0), this.uiManager.showSpinner(this.translation.t("loading"));
|
|
1359
1362
|
try {
|
|
1360
|
-
await this.options.onSubmit({
|
|
1363
|
+
let t = await this.options.onSubmit({
|
|
1361
1364
|
formData: null,
|
|
1362
1365
|
applePayData: e.applePayData
|
|
1363
|
-
})
|
|
1366
|
+
});
|
|
1367
|
+
return this.uiManager.hideSpinner(), this.options.onLoadingStateChange?.(!1), this.stateCoordinator.setSubmitting(!1), this.updateFormUI(), t;
|
|
1364
1368
|
} catch {
|
|
1365
|
-
this.uiManager.setErrorMessage("Apple Pay processing failed. Please try again."), this.uiManager.hideSpinner(), this.options.onLoadingStateChange?.(!1), this.stateCoordinator.setSubmitting(!1), this.updateFormUI();
|
|
1369
|
+
return this.uiManager.setErrorMessage("Apple Pay processing failed. Please try again."), this.uiManager.hideSpinner(), this.options.onLoadingStateChange?.(!1), this.stateCoordinator.setSubmitting(!1), this.updateFormUI(), !1;
|
|
1366
1370
|
}
|
|
1367
1371
|
}
|
|
1368
1372
|
setErrorMessage(e) {
|
|
@@ -1381,7 +1385,7 @@ var Z = (e) => ({
|
|
|
1381
1385
|
this.options.paymentId = e, this.options.checkoutKey = n, this.options.supportedPaymentMethods = r, this.options.checkoutDetails = i, this.componentManager.setCheckoutDetailsLoaded(!0), a && !this.vgsService && (this.vgsJwt = a, this.vgsService = new t(), this.componentManager.setVgsService(this.vgsService), this.stateCoordinator.setVgsMode(!0), this.vgsService.init(this.options.environment).then((e) => {
|
|
1382
1386
|
this.vgsService?.createForm(e, (e) => this.handleVgsStateChange(e)), this.renderFormComponents();
|
|
1383
1387
|
}).catch((e) => {
|
|
1384
|
-
console.error("Failed to load VGS Collect:", e), this.
|
|
1388
|
+
console.error("Failed to load VGS Collect:", e), this.fallBackToNativeCardFields();
|
|
1385
1389
|
})), this.componentManager.removePaymentMethods(), this.componentManager.updateSupportedPaymentMethods(r), this.componentManager.updatePaymentDetails(e, n, i), !a && this.checkoutProfile.getState().checkoutProfile && this.renderFormComponents();
|
|
1386
1390
|
let o = this.checkoutProfile.getState();
|
|
1387
1391
|
if (o.checkoutProfile) {
|
|
@@ -1475,11 +1479,11 @@ var Z = (e) => ({
|
|
|
1475
1479
|
stateManager;
|
|
1476
1480
|
sessionId;
|
|
1477
1481
|
constructor(e) {
|
|
1478
|
-
this.config = this.validateConfig(e), this._callbacks = { ...this.config.callbacks }, this.paymentState = {}, this.sessionId = crypto.randomUUID(),
|
|
1482
|
+
this.config = this.validateConfig(e), this._callbacks = { ...this.config.callbacks }, this.paymentState = {}, this.sessionId = crypto.randomUUID(), a({
|
|
1479
1483
|
environment: this.config.environment,
|
|
1480
1484
|
sessionId: this.sessionId,
|
|
1481
1485
|
integration: "dropin"
|
|
1482
|
-
}),
|
|
1486
|
+
}), N(_.CHECKOUT_INITIALIZED, { environment: this.config.environment }), this.apiService = new te(this.config.apiKey, this.config.environment), this.stateManager = new fe({
|
|
1483
1487
|
mounted: !1,
|
|
1484
1488
|
form: null
|
|
1485
1489
|
}), this.formManager = new de({
|
|
@@ -1513,13 +1517,23 @@ var Z = (e) => ({
|
|
|
1513
1517
|
};
|
|
1514
1518
|
}
|
|
1515
1519
|
mount(e) {
|
|
1516
|
-
let t
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1520
|
+
let t;
|
|
1521
|
+
try {
|
|
1522
|
+
let n = document.querySelector(e);
|
|
1523
|
+
if (!n) throw Error(`Container ${e} not found`);
|
|
1524
|
+
return t = document.createElement("div"), n.appendChild(t), this.stateManager.updateState({
|
|
1525
|
+
form: t,
|
|
1526
|
+
mounted: !0
|
|
1527
|
+
}), this.formManager.mount(t), N(_.CHECKOUT_MOUNTED, { container_id: e }), this;
|
|
1528
|
+
} catch (n) {
|
|
1529
|
+
throw t?.remove(), this.stateManager.updateState({
|
|
1530
|
+
form: null,
|
|
1531
|
+
mounted: !1
|
|
1532
|
+
}), N(_.CHECKOUT_MOUNT_FAILED, {
|
|
1533
|
+
container_id: e,
|
|
1534
|
+
error_message: n instanceof Error ? n.message : "Unknown error"
|
|
1535
|
+
}), l(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount checkout"), { container_id: e }), n;
|
|
1536
|
+
}
|
|
1523
1537
|
}
|
|
1524
1538
|
unmount() {
|
|
1525
1539
|
let { mounted: e } = this.stateManager.getState();
|
|
@@ -1529,13 +1543,13 @@ var Z = (e) => ({
|
|
|
1529
1543
|
e && e.remove(), this.stateManager.updateState({
|
|
1530
1544
|
form: null,
|
|
1531
1545
|
mounted: !1
|
|
1532
|
-
}),
|
|
1546
|
+
}), N(_.CHECKOUT_UNMOUNTED);
|
|
1533
1547
|
});
|
|
1534
1548
|
}
|
|
1535
1549
|
async handleSubmit({ formData: e, applePayData: t }) {
|
|
1536
1550
|
if (!this.paymentState.paymentId || !this.paymentState.checkoutKey) throw Error("Payment must be associated before submitting. Call associatePayment() first.");
|
|
1537
1551
|
let n = this.getPaymentMethod(e, t);
|
|
1538
|
-
|
|
1552
|
+
N(_.PAYMENT_SUBMIT_STARTED, {
|
|
1539
1553
|
payment_id: this.paymentState.paymentId,
|
|
1540
1554
|
payment_method: n
|
|
1541
1555
|
});
|
|
@@ -1548,41 +1562,43 @@ var Z = (e) => ({
|
|
|
1548
1562
|
returnUrl: this.config.returnUrl,
|
|
1549
1563
|
applePayData: t
|
|
1550
1564
|
}), a = performance.now() - r;
|
|
1551
|
-
|
|
1565
|
+
return v(y.PAYMENT_AUTHORIZATION_TIME, a, "ms", {
|
|
1552
1566
|
payment_id: this.paymentState.paymentId,
|
|
1553
1567
|
payment_method: n,
|
|
1554
1568
|
status: "success"
|
|
1555
|
-
}),
|
|
1569
|
+
}), N(_.PAYMENT_SUBMIT_SUCCESS, {
|
|
1556
1570
|
payment_id: this.paymentState.paymentId,
|
|
1557
1571
|
payment_method: n
|
|
1558
1572
|
}), this.handlePaymentResponse(i);
|
|
1559
1573
|
} catch (e) {
|
|
1560
1574
|
let t = performance.now() - r;
|
|
1561
|
-
|
|
1575
|
+
return v(y.PAYMENT_AUTHORIZATION_TIME, t, "ms", {
|
|
1562
1576
|
payment_id: this.paymentState.paymentId,
|
|
1563
1577
|
payment_method: n,
|
|
1564
1578
|
status: "failed"
|
|
1565
|
-
}),
|
|
1579
|
+
}), N(_.PAYMENT_SUBMIT_FAILED, {
|
|
1566
1580
|
payment_id: this.paymentState.paymentId,
|
|
1567
1581
|
payment_method: n,
|
|
1568
1582
|
error_message: e.details?.message ?? "Unknown error"
|
|
1569
|
-
}), this.handleAuthorizationError(e);
|
|
1583
|
+
}), this.handleAuthorizationError(e), !1;
|
|
1570
1584
|
}
|
|
1571
1585
|
}
|
|
1572
1586
|
handlePaymentResponse(e) {
|
|
1573
|
-
|
|
1587
|
+
let t = !1;
|
|
1588
|
+
if (e.latestTransaction.status === "authorized" && (N(_.PAYMENT_AUTHORIZED, {
|
|
1574
1589
|
payment_id: this.paymentState.paymentId ?? "",
|
|
1575
1590
|
status: e.latestTransaction.status
|
|
1576
|
-
}), this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status)), e.latestTransaction.status === "failed" && (
|
|
1591
|
+
}), this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status), t = !0), e.latestTransaction.status === "failed" && (N(_.PAYMENT_FAILED, {
|
|
1577
1592
|
payment_id: this.paymentState.paymentId ?? "",
|
|
1578
1593
|
status: e.latestTransaction.status
|
|
1579
1594
|
}), this._callbacks.onPaymentFailed?.(e.latestTransaction.status)), e.status === "requires_action") {
|
|
1580
|
-
let { redirectUrl:
|
|
1581
|
-
|
|
1595
|
+
let { redirectUrl: n } = e.action;
|
|
1596
|
+
N(_.PAYMENT_ACTION_REQUIRED, {
|
|
1582
1597
|
payment_id: this.paymentState.paymentId ?? "",
|
|
1583
1598
|
status: e.status
|
|
1584
|
-
}), this.config.manualActionHandling ? this._callbacks.onActionRequired?.(
|
|
1599
|
+
}), this.config.manualActionHandling ? this._callbacks.onActionRequired?.(n) : globalThis.location.href = n, t = !0;
|
|
1585
1600
|
}
|
|
1601
|
+
return t;
|
|
1586
1602
|
}
|
|
1587
1603
|
handleAuthorizationError(e) {
|
|
1588
1604
|
this._callbacks.onPaymentFailed?.(e.details?.message);
|
|
@@ -1614,7 +1630,7 @@ var Z = (e) => ({
|
|
|
1614
1630
|
if (!e || !t) throw Error("paymentId and checkoutKey are required");
|
|
1615
1631
|
this.paymentState.paymentId = e, this.paymentState.checkoutKey = t;
|
|
1616
1632
|
try {
|
|
1617
|
-
let n = await
|
|
1633
|
+
let n = await h({
|
|
1618
1634
|
id: e,
|
|
1619
1635
|
checkoutKey: t,
|
|
1620
1636
|
environment: this.config.environment
|
|
@@ -1627,16 +1643,16 @@ var Z = (e) => ({
|
|
|
1627
1643
|
countryCode: n.countryCode
|
|
1628
1644
|
};
|
|
1629
1645
|
let r = n.supportedPaymentMethods.reduce((e, t) => (e[t] = !0, e), {});
|
|
1630
|
-
await this.formManager.associatePayment(e, t, r, this.paymentState.checkoutDetails, n.vgsJwt),
|
|
1646
|
+
await this.formManager.associatePayment(e, t, r, this.paymentState.checkoutDetails, n.vgsJwt), N(_.PAYMENT_ASSOCIATED, {
|
|
1631
1647
|
payment_id: e,
|
|
1632
1648
|
currency: n.currency,
|
|
1633
1649
|
country_code: n.countryCode
|
|
1634
1650
|
});
|
|
1635
1651
|
} catch (t) {
|
|
1636
|
-
throw
|
|
1652
|
+
throw N(_.PAYMENT_ASSOCIATION_FAILED, {
|
|
1637
1653
|
payment_id: e,
|
|
1638
1654
|
error_message: t instanceof Error ? t.message : "Unknown error"
|
|
1639
|
-
}),
|
|
1655
|
+
}), l(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to associate payment"), { payment_id: e }), t;
|
|
1640
1656
|
}
|
|
1641
1657
|
}
|
|
1642
1658
|
setCallbacks(e) {
|
|
@@ -1647,4 +1663,4 @@ var Z = (e) => ({
|
|
|
1647
1663
|
//#region libs/checkout/src/index.ts
|
|
1648
1664
|
typeof globalThis < "u" && (globalThis.OdusCheckout = $);
|
|
1649
1665
|
//#endregion
|
|
1650
|
-
export { $ as OdusCheckout, i as deLocale, m as enLocale, f as esLocale, d as frLocale,
|
|
1666
|
+
export { $ as OdusCheckout, i as deLocale, m as enLocale, f as esLocale, d as frLocale, E as itLocale, e as plLocale, D as ptLocale, l as pushError, N as pushEvent, c as pushLog, v as pushMeasurement, p as trLocale };
|
|
@@ -7,10 +7,14 @@ export declare const browserInfo: {
|
|
|
7
7
|
};
|
|
8
8
|
export interface FormOptions {
|
|
9
9
|
apiKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves to `true` when the SDK reported a success or a required action to
|
|
12
|
+
* the merchant. A decline or an error resolves to `false`.
|
|
13
|
+
*/
|
|
10
14
|
onSubmit: (data: {
|
|
11
15
|
formData: FormData | null;
|
|
12
16
|
applePayData?: ApplePayData;
|
|
13
|
-
}) => Promise<
|
|
17
|
+
}) => Promise<boolean>;
|
|
14
18
|
locale?: Locale | null;
|
|
15
19
|
errorMsg?: string;
|
|
16
20
|
container: HTMLElement;
|
|
@@ -49,6 +53,11 @@ export declare class Form extends Component<HTMLFormElement> {
|
|
|
49
53
|
constructor(options: FormOptions);
|
|
50
54
|
private _getFormStateData;
|
|
51
55
|
private initializeForm;
|
|
56
|
+
/**
|
|
57
|
+
* VGS cannot render the card fields, so every collaborator that still points
|
|
58
|
+
* at the service must drop it before the form draws its own inputs.
|
|
59
|
+
*/
|
|
60
|
+
private fallBackToNativeCardFields;
|
|
52
61
|
private renderFormComponents;
|
|
53
62
|
private updateFormUI;
|
|
54
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../src/components/checkout/form/Form.ts"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAC;AAWzC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACd,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAEV,YAAY,EACZ,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAMnE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAgBF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;QAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,KAAK,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../src/components/checkout/form/Form.ts"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAC;AAWzC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACd,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAEV,YAAY,EACZ,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAMnE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAgBF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,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: () => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves to `true` when the SDK reported a success or a required action to
|
|
18
|
+
* the merchant. A decline or an error resolves to `false`.
|
|
19
|
+
*/
|
|
16
20
|
onApplePaySubmit: (data: {
|
|
17
21
|
formData?: FormData;
|
|
18
22
|
applePayData?: ApplePayData;
|
|
19
|
-
}) => Promise<
|
|
23
|
+
}) => Promise<boolean>;
|
|
20
24
|
supportedPaymentMethods?: {
|
|
21
25
|
card?: boolean;
|
|
22
26
|
paypal?: boolean;
|
|
@@ -104,7 +108,7 @@ export declare class FormComponentManager {
|
|
|
104
108
|
countryCode: string;
|
|
105
109
|
}): void;
|
|
106
110
|
hasComponents(): boolean;
|
|
107
|
-
setVgsService(vgsService
|
|
111
|
+
setVgsService(vgsService?: VGSCollectService): void;
|
|
108
112
|
private buildCardSkeleton;
|
|
109
113
|
private createHelperTextSpacer;
|
|
110
114
|
private createSkeletonDiv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormComponentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/checkout/form/FormComponentManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACb,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK7D,UAAU,uBAAuB;IAC/B,WAAW,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC/B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,gBAAgB,EAAE,CAAC,IAAI,EAAE;QACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,KAAK,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"FormComponentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/checkout/form/FormComponentManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACb,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK7D,UAAU,uBAAuB;IAC/B,WAAW,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,C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ACnB,eAAe,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB;IAOH,aAAa;IAIb,aAAa,CAAC,UAAU,CAAC,EAAE,iBAAiB;IAI5C,OAAO,CAAC,iBAAiB;IAoEzB,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,uBAAuB;IAiCzB,cAAc,CAAC,eAAe,EAAE,eAAe;IA6DrD,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,cAAc;IAKtE,OAAO;CAqGR"}
|
|
@@ -8,10 +8,14 @@ interface PaymentMethodsOptions {
|
|
|
8
8
|
onPaypalSubmit?: (data: {
|
|
9
9
|
formData?: FormData;
|
|
10
10
|
}) => Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves to `true` when the SDK reported a success or a required action to
|
|
13
|
+
* the merchant. A decline or an error resolves to `false`.
|
|
14
|
+
*/
|
|
11
15
|
onApplePaySubmit?: (data: {
|
|
12
16
|
formData?: FormData;
|
|
13
17
|
applePayData?: ApplePayData;
|
|
14
|
-
}) => Promise<
|
|
18
|
+
}) => Promise<boolean>;
|
|
15
19
|
supportedPaymentMethods?: {
|
|
16
20
|
card?: boolean;
|
|
17
21
|
paypal?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentMethods.d.ts","sourceRoot":"","sources":["../../../../src/components/checkout/form/PaymentMethods.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CA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AAE,OAAO,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;KACpC,CAAC;IACF,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,qBAAa,cAAe,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC3D,OAAO,CAAC,cAAc,CAAyB;IAC/C,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,CAAe;gBAEpB,OAAO,EAAE,qBAAqB;IAiI1C,OAAO,CAAC,cAAc;IAKf,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAoBxC,wBAAwB,IAAI,OAAO;CAK3C"}
|
|
@@ -5,10 +5,18 @@ import { Component } from '../../Component';
|
|
|
5
5
|
interface ApplePayButtonOptions {
|
|
6
6
|
checkoutProfile: CheckoutProfile;
|
|
7
7
|
formData?: FormData;
|
|
8
|
+
/**
|
|
9
|
+
* Authorizes the payment. It resolves to `true` when the SDK reported a
|
|
10
|
+
* success or a required action to the merchant, so the sheet can close with
|
|
11
|
+
* the checkmark that means the payment went through. A required action
|
|
12
|
+
* counts, because the sheet has to close before the shopper can be sent to
|
|
13
|
+
* the redirect. A decline, an error, or any outcome the SDK could not
|
|
14
|
+
* confirm resolves to `false`.
|
|
15
|
+
*/
|
|
8
16
|
onSubmit?: (data: {
|
|
9
17
|
formData?: FormData;
|
|
10
18
|
applePayData?: ApplePayData;
|
|
11
|
-
}) => Promise<
|
|
19
|
+
}) => Promise<boolean>;
|
|
12
20
|
paymentId: string;
|
|
13
21
|
checkoutKey: string;
|
|
14
22
|
checkoutDetails?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplePayButton.d.ts","sourceRoot":"","sources":["../../../../src/components/payment-methods/applePay/ApplePayButton.ts"],"names":[],"mappings":"AACA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,UAAU,qBAAqB;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,KAAK,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"ApplePayButton.d.ts","sourceRoot":"","sources":["../../../../src/components/payment-methods/applePay/ApplePayButton.ts"],"names":[],"mappings":"AACA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACT,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,UAAU,qBAAqB;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,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aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACxC,GAAG,OAAO,CAAC,CAAC,CAAC;IAgDR,gBAAgB,CAAC,EACrB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,kBAAkB,GACnB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9C,GAAG,OAAO,CAAC,OAAO,CAAC;CAiKrB"}
|
|
@@ -14,7 +14,11 @@ interface PaymentContext {
|
|
|
14
14
|
countries?: string[];
|
|
15
15
|
requiredBillingContactFields?: ApplePayContactField[];
|
|
16
16
|
requiredShippingContactFields?: ApplePayContactField[];
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Resolves to `true` when the SDK reported a success or a required action to
|
|
19
|
+
* the merchant. A decline or an error resolves to `false`.
|
|
20
|
+
*/
|
|
21
|
+
onAuthorize: (applePayData: ApplePayData) => Promise<boolean>;
|
|
18
22
|
}
|
|
19
23
|
export declare class ApplePayElement extends BaseElement {
|
|
20
24
|
private _paymentContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplePayElement.d.ts","sourceRoot":"","sources":["../../src/elements/ApplePayElement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA+B5C,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,M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eAAe,CAA+B;IACtD,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,YAAY,CAAS;IAE7B;;;;;OAKG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAOhD,SAAS,CAAC,MAAM,IAAI,IAAI;IA4ExB,OAAO,CAAC,gBAAgB;cAWL,MAAM,IAAI,MAAM;IAenC,SAAS,CAAC,QAAQ,IAAI,YAAY,GAAG,IAAI;IAIzC,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B,SAAS,CAAC,QAAQ,IAAI,MAAM,GAAG,IAAI;CAGpC"}
|
|
@@ -28,6 +28,7 @@ export declare class OdusElements {
|
|
|
28
28
|
private readonly _changeListeners;
|
|
29
29
|
private _callbacks;
|
|
30
30
|
private _paymentState;
|
|
31
|
+
private _associationSequence;
|
|
31
32
|
private _fontCleanup?;
|
|
32
33
|
private readonly _sessionId;
|
|
33
34
|
private _mountedReported;
|
|
@@ -72,11 +73,36 @@ export declare class OdusElements {
|
|
|
72
73
|
setCallbacks(callbacks: Partial<OdusElementsCallbacks>): void;
|
|
73
74
|
private _trackElement;
|
|
74
75
|
private _allElements;
|
|
76
|
+
/**
|
|
77
|
+
* Runs the authorization and reports whether it succeeded.
|
|
78
|
+
*
|
|
79
|
+
* The merchant callbacks keep swallowing every failure — a decline is a
|
|
80
|
+
* normal outcome, not an exception — so the return value is what tells an
|
|
81
|
+
* express button whether it may show the shopper a success. It is `true`
|
|
82
|
+
* only when the SDK reported a success or a required action to the merchant.
|
|
83
|
+
*/
|
|
75
84
|
private _executeAuthorization;
|
|
76
85
|
private _getPaymentMethod;
|
|
77
86
|
private _emitLoadingState;
|
|
87
|
+
/**
|
|
88
|
+
* Reports the outcome to the merchant, and answers whether that outcome is
|
|
89
|
+
* one the shopper may see as a success. A required action counts: the sheet
|
|
90
|
+
* has to close before the merchant can send the shopper to the redirect.
|
|
91
|
+
*/
|
|
78
92
|
private _handlePaymentResponse;
|
|
93
|
+
/**
|
|
94
|
+
* Reports a submission that never reached the API. The submit funnel still
|
|
95
|
+
* gets both stages, so an attempt that failed before the request is counted
|
|
96
|
+
* as a failure instead of disappearing from the funnel.
|
|
97
|
+
*/
|
|
98
|
+
private _reportSubmitFailure;
|
|
79
99
|
private _handleAuthorizationError;
|
|
100
|
+
/**
|
|
101
|
+
* `ApiError` carries the readable text at the top level. `details` holds the
|
|
102
|
+
* raw API body, where `message` is absent on some failures, so it is only a
|
|
103
|
+
* fallback.
|
|
104
|
+
*/
|
|
105
|
+
private _readErrorMessage;
|
|
80
106
|
}
|
|
81
107
|
export {};
|
|
82
108
|
//# sourceMappingURL=OdusElements.d.ts.map
|