@odus/checkout 1.16.1 → 1.17.0-beta.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 +136 -136
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements.es.js +217 -217
- package/dist/loader.es.js +87 -0
- package/dist/phone.js +37 -37
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/shared.js +3 -3
- package/dist/types/payment/Payment.type.d.ts +2 -1
- package/dist/types/payment/Payment.type.d.ts.map +1 -1
- package/dist/utils/helpers/paymentResult.util.d.ts +12 -0
- package/dist/utils/helpers/paymentResult.util.d.ts.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region libs/checkout/src/loader/loadOdus.ts
|
|
2
|
+
var e = "https://js.odus.com", t = "1.17.0-beta.1", n = {
|
|
3
|
+
test: "https://sandbox-analytics.odus.com/collect",
|
|
4
|
+
live: "https://analytics.odus.com/collect"
|
|
5
|
+
}, r = {
|
|
6
|
+
checkout: "OdusCheckout",
|
|
7
|
+
elements: "OdusElements"
|
|
8
|
+
}, i = class extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(e, t) {
|
|
11
|
+
super(t), this.name = "OdusLoadError", this.code = e;
|
|
12
|
+
}
|
|
13
|
+
}, a = /* @__PURE__ */ new Map(), o = !1;
|
|
14
|
+
function s() {
|
|
15
|
+
if (o || typeof document > "u") return;
|
|
16
|
+
o = !0;
|
|
17
|
+
let t = document.createElement("link");
|
|
18
|
+
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.append(t);
|
|
19
|
+
}
|
|
20
|
+
s();
|
|
21
|
+
function c(e, r, i, a) {
|
|
22
|
+
try {
|
|
23
|
+
if (/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$|\.localhost$/.test(window.location.hostname)) return;
|
|
24
|
+
window.navigator.sendBeacon(n[e], JSON.stringify({
|
|
25
|
+
meta: {
|
|
26
|
+
app: {
|
|
27
|
+
name: "odus-checkout",
|
|
28
|
+
version: t,
|
|
29
|
+
environment: e === "test" ? "sandbox" : "production"
|
|
30
|
+
},
|
|
31
|
+
page: { url: window.location.origin }
|
|
32
|
+
},
|
|
33
|
+
events: [{
|
|
34
|
+
name: "checkout.runtime.load_failed",
|
|
35
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
36
|
+
attributes: {
|
|
37
|
+
code: i,
|
|
38
|
+
integration: r === "checkout" ? "dropin" : "elements",
|
|
39
|
+
delivery: "cdn",
|
|
40
|
+
loader_version: t,
|
|
41
|
+
runtime: a
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
44
|
+
}));
|
|
45
|
+
} catch {}
|
|
46
|
+
}
|
|
47
|
+
function l(e, n, a) {
|
|
48
|
+
let { environment: o = "live", timeout: s = 15e3, integrity: l } = a, u = performance.now();
|
|
49
|
+
return new Promise((d, f) => {
|
|
50
|
+
let p = !1, m = !1, h = (e) => {
|
|
51
|
+
e.disposition !== "report" && `${e.blockedURI}/`.startsWith("https://js.odus.com/") && (p = !0);
|
|
52
|
+
}, g = () => !m && (m = !0, clearTimeout(y), document.removeEventListener("securitypolicyviolation", h), !0), _ = (t, n) => {
|
|
53
|
+
g() && (c(o, e, t, a.version ?? "channel"), f(new i(t, n)));
|
|
54
|
+
}, v = (e) => _(p ? "blocked_by_csp" : "network", `${e} ${p ? "was blocked by the page CSP" : "could not load"}: ${n}`);
|
|
55
|
+
document.addEventListener("securitypolicyviolation", h);
|
|
56
|
+
let y = setTimeout(() => _("timeout", `No runtime within ${s} ms: ${n}`), s), b = globalThis.__ODUS_RUNTIME__ ??= {};
|
|
57
|
+
delete b[1];
|
|
58
|
+
let x = document.createElement("script");
|
|
59
|
+
x.src = n, x.crossOrigin = "anonymous", l && (x.integrity = l), x.addEventListener("error", () => setTimeout(() => v("The Odus runtime"))), x.addEventListener("load", () => {
|
|
60
|
+
let i = b[1];
|
|
61
|
+
if (delete b[1], m) return;
|
|
62
|
+
let a;
|
|
63
|
+
try {
|
|
64
|
+
a = i?.boot?.({
|
|
65
|
+
contract: 1,
|
|
66
|
+
loader: t,
|
|
67
|
+
started: u
|
|
68
|
+
});
|
|
69
|
+
} catch {}
|
|
70
|
+
if (typeof a?.[r[e]] != "function" || typeof a.version != "string") {
|
|
71
|
+
_("incompatible_runtime", `${n} did not register a contract 1 runtime`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let o = a;
|
|
75
|
+
Promise.resolve(o.styles).then(() => {
|
|
76
|
+
g() && d(o);
|
|
77
|
+
}, () => setTimeout(() => v("The Odus runtime stylesheet")));
|
|
78
|
+
}), document.head.append(x);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function u(n, r = {}) {
|
|
82
|
+
s();
|
|
83
|
+
let i = r.version ? `${e}/r/${r.version}/${n}.js` : `${e}/v1/${n}.js?min=${t}`, o = `${i} ${r.integrity ?? ""}`, c = a.get(o);
|
|
84
|
+
return c || (c = l(n, i, r), a.set(o, c), c.catch(() => a.delete(o))), c;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { i as OdusLoadError, e as RUNTIME_ORIGIN, u as loadOdus };
|
package/dist/phone.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as e, g as t, h as n, m as r, v as i, x as a } from "./shared.js";
|
|
2
2
|
import { t as o } from "./shared2.js";
|
|
3
3
|
//#region libs/checkout/src/utils/dom/restoreCursorAfterFormat.util.ts
|
|
4
4
|
var s = (e, t, n) => {
|
|
@@ -10458,29 +10458,29 @@ function xi() {
|
|
|
10458
10458
|
var X = (e) => {
|
|
10459
10459
|
let t = e.toUpperCase().split("").map((e) => 127397 + e.charCodeAt(0));
|
|
10460
10460
|
return String.fromCodePoint(...t);
|
|
10461
|
-
}, Si = (
|
|
10462
|
-
let
|
|
10463
|
-
return (
|
|
10461
|
+
}, Si = (t, n) => {
|
|
10462
|
+
let r = Object.values(e);
|
|
10463
|
+
return (t?.length ? r.filter((e) => t.includes(e.toUpperCase())) : r).map((e) => {
|
|
10464
10464
|
try {
|
|
10465
|
-
let
|
|
10465
|
+
let t = bi(e);
|
|
10466
10466
|
return {
|
|
10467
10467
|
code: e.toUpperCase(),
|
|
10468
|
-
name:
|
|
10469
|
-
dialCode: `+${
|
|
10468
|
+
name: i(e, n),
|
|
10469
|
+
dialCode: `+${t}`,
|
|
10470
10470
|
flag: X(e)
|
|
10471
10471
|
};
|
|
10472
10472
|
} catch {
|
|
10473
10473
|
return null;
|
|
10474
10474
|
}
|
|
10475
|
-
}).filter((e) => e !== null).sort((e, t) => e.name.localeCompare(t.name,
|
|
10475
|
+
}).filter((e) => e !== null).sort((e, t) => e.name.localeCompare(t.name, n));
|
|
10476
10476
|
}, Ci = (e) => {
|
|
10477
10477
|
try {
|
|
10478
|
-
let
|
|
10478
|
+
let t = e.toUpperCase(), n = bi(t);
|
|
10479
10479
|
return {
|
|
10480
|
-
code:
|
|
10481
|
-
name: t
|
|
10482
|
-
dialCode: `+${
|
|
10483
|
-
flag: X(
|
|
10480
|
+
code: t,
|
|
10481
|
+
name: i(t),
|
|
10482
|
+
dialCode: `+${n}`,
|
|
10483
|
+
flag: X(t)
|
|
10484
10484
|
};
|
|
10485
10485
|
} catch {
|
|
10486
10486
|
return null;
|
|
@@ -10777,19 +10777,19 @@ var X = (e) => {
|
|
|
10777
10777
|
} catch {
|
|
10778
10778
|
return Infinity;
|
|
10779
10779
|
}
|
|
10780
|
-
}, Oi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2 3.5L5 6.5L8 3.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>", ki = class extends
|
|
10780
|
+
}, Oi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2 3.5L5 6.5L8 3.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>", ki = class extends a {
|
|
10781
10781
|
_flagDisplay;
|
|
10782
10782
|
_selectElement;
|
|
10783
10783
|
_locale;
|
|
10784
10784
|
constructor(e) {
|
|
10785
10785
|
super("div", ["country-select-wrapper"]);
|
|
10786
|
-
let { countries: t, selectedCode:
|
|
10787
|
-
this._locale =
|
|
10786
|
+
let { countries: t, selectedCode: n, locale: r, styles: i, ariaLabel: o, onChange: s } = e;
|
|
10787
|
+
this._locale = r, this._flagDisplay = new a("span", ["country-flag"]), this._flagDisplay.setText(X(n)), this._selectElement = new a("select", ["country-select"]), this._selectElement.setAttribute("aria-label", o);
|
|
10788
10788
|
let c = this._selectElement.getElement();
|
|
10789
|
-
c.style.fontFamily = `"${
|
|
10789
|
+
c.style.fontFamily = `"${i.fontFamily}", sans-serif`, c.style.color = i.textColor, c.style.fontSize = `${i.fontSize}px`, this._buildOptions(t, n), this._selectElement.addEventListener("change", (e) => {
|
|
10790
10790
|
s(e.target.value);
|
|
10791
10791
|
});
|
|
10792
|
-
let l = new
|
|
10792
|
+
let l = new a("span", ["country-chevron"]);
|
|
10793
10793
|
l.getElement().innerHTML = Oi, this.appendChild(this._flagDisplay), this.appendChild(l), this.appendChild(this._selectElement);
|
|
10794
10794
|
}
|
|
10795
10795
|
setCountry(e) {
|
|
@@ -10813,7 +10813,7 @@ var X = (e) => {
|
|
|
10813
10813
|
}), n.appendChild(i);
|
|
10814
10814
|
});
|
|
10815
10815
|
}
|
|
10816
|
-
}, Ai = class extends
|
|
10816
|
+
}, Ai = class extends a {
|
|
10817
10817
|
_countrySelector;
|
|
10818
10818
|
_inputElement;
|
|
10819
10819
|
_countryCodeInput;
|
|
@@ -10827,21 +10827,21 @@ var X = (e) => {
|
|
|
10827
10827
|
_customPlaceholder;
|
|
10828
10828
|
constructor(e) {
|
|
10829
10829
|
super("div", ["input-wrapper", "phone-number-field-wrapper"]);
|
|
10830
|
-
let { value:
|
|
10831
|
-
this._onChange =
|
|
10830
|
+
let { value: r, onChange: i, onBlur: o, onTab: s, checkoutProfile: c, translationFunc: l, defaultCountry: u, allowedCountries: d, locale: f, label: p, placeholder: m } = e;
|
|
10831
|
+
this._onChange = i, this._onBlur = o, this._translationFunc = l, this._customPlaceholder = m, this._currentCountryCode = u?.toUpperCase() || "US", this._buildLabel(c, l, p), this._containerElement = this._buildContainer(c), this._countrySelector = this._buildCountrySelector(d, f, c, l), this._containerElement.appendChild(this._countrySelector), this._countryCodeInput = n.createInput("hidden", [], {
|
|
10832
10832
|
name: "phoneCountryCode",
|
|
10833
10833
|
value: this._currentCountryCode
|
|
10834
10834
|
}), this.appendChild(this._countryCodeInput);
|
|
10835
|
-
let h = this._currentCountryCode, { inputElement: g, initialValue: _ } = this._buildInput(c,
|
|
10836
|
-
this._inputElement = g, _ !==
|
|
10837
|
-
let v = new
|
|
10838
|
-
v.appendChild(this._inputElement), this._containerElement.appendChild(v), this.appendChild(this._containerElement), this._helperText = new
|
|
10835
|
+
let h = this._currentCountryCode, { inputElement: g, initialValue: _ } = this._buildInput(c, r, s);
|
|
10836
|
+
this._inputElement = g, _ !== r && (this._inputElement.getElement().value = _), this._currentCountryCode !== h && this._syncCountryCodeInput(this._currentCountryCode);
|
|
10837
|
+
let v = new a("div", ["phone-input-wrapper"]);
|
|
10838
|
+
v.appendChild(this._inputElement), this._containerElement.appendChild(v), this.appendChild(this._containerElement), this._helperText = new t({
|
|
10839
10839
|
text: e.errorMsg || "",
|
|
10840
10840
|
visible: e.error
|
|
10841
10841
|
}), this.appendChild(this._helperText), e.error && this._containerElement.addClass("error");
|
|
10842
10842
|
}
|
|
10843
10843
|
_buildLabel(e, t, n) {
|
|
10844
|
-
let
|
|
10844
|
+
let i = new r({
|
|
10845
10845
|
styles: {
|
|
10846
10846
|
color: e.styles.textColor,
|
|
10847
10847
|
fontSize: e.styles.fontSize
|
|
@@ -10849,11 +10849,11 @@ var X = (e) => {
|
|
|
10849
10849
|
label: n ?? t("phoneNumber"),
|
|
10850
10850
|
id: "phoneNumber"
|
|
10851
10851
|
});
|
|
10852
|
-
this.appendChild(
|
|
10852
|
+
this.appendChild(i);
|
|
10853
10853
|
}
|
|
10854
10854
|
_buildContainer(e) {
|
|
10855
|
-
let t = new
|
|
10856
|
-
return
|
|
10855
|
+
let t = new a("div", ["phone-number-field-container"]), n = t.getElement();
|
|
10856
|
+
return n.style.borderRadius = `${e.styles.borderRadius}px`, n.style.setProperty("--phone-border-radius", `${e.styles.borderRadius}px`), t;
|
|
10857
10857
|
}
|
|
10858
10858
|
_buildCountrySelector(e, t, n, r) {
|
|
10859
10859
|
return new ki({
|
|
@@ -10871,17 +10871,17 @@ var X = (e) => {
|
|
|
10871
10871
|
}
|
|
10872
10872
|
});
|
|
10873
10873
|
}
|
|
10874
|
-
_buildInput(e, t,
|
|
10875
|
-
let
|
|
10874
|
+
_buildInput(e, t, r) {
|
|
10875
|
+
let i = t;
|
|
10876
10876
|
if (t && t.startsWith("+")) {
|
|
10877
10877
|
let e = Q(t);
|
|
10878
|
-
e && (this._currentCountryCode = e.countryCode, this._countrySelector.setCountry(e.countryCode),
|
|
10878
|
+
e && (this._currentCountryCode = e.countryCode, this._countrySelector.setCountry(e.countryCode), i = Z(t, e.countryCode));
|
|
10879
10879
|
}
|
|
10880
|
-
let a =
|
|
10880
|
+
let a = n.createInput("tel", ["form-input"], {
|
|
10881
10881
|
id: "phoneNumber",
|
|
10882
10882
|
name: "phoneNumber",
|
|
10883
10883
|
placeholder: this._customPlaceholder ?? $(this._currentCountryCode),
|
|
10884
|
-
value:
|
|
10884
|
+
value: i,
|
|
10885
10885
|
autocomplete: "tel",
|
|
10886
10886
|
maxlength: "30"
|
|
10887
10887
|
}), o = a.getElement();
|
|
@@ -10891,12 +10891,12 @@ var X = (e) => {
|
|
|
10891
10891
|
this._containerElement.addClass("focused");
|
|
10892
10892
|
}), a.addEventListener("blur", (e) => {
|
|
10893
10893
|
this._containerElement.removeClass("focused"), this._validateInput(this._inputElement.getElement().value, !0), this._onBlur(e);
|
|
10894
|
-
}),
|
|
10894
|
+
}), r && a.addEventListener("keydown", (e) => {
|
|
10895
10895
|
let t = e;
|
|
10896
|
-
t.key === "Tab" && !t.shiftKey && (t.preventDefault(),
|
|
10896
|
+
t.key === "Tab" && !t.shiftKey && (t.preventDefault(), r());
|
|
10897
10897
|
}), {
|
|
10898
10898
|
inputElement: a,
|
|
10899
|
-
initialValue:
|
|
10899
|
+
initialValue: i
|
|
10900
10900
|
};
|
|
10901
10901
|
}
|
|
10902
10902
|
_handleInput(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout.service.d.ts","sourceRoot":"","sources":["../../../src/services/checkout/Checkout.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkout.service.d.ts","sourceRoot":"","sources":["../../../src/services/checkout/Checkout.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAoD7D,cAAM,QAAQ;IACZ,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,mBAAmB,CAAK;gBAEpB,MAAM,EAAE,cAAc;IAoDlC,OAAO,CAAC,cAAc;IA4Bf,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAkEhC,OAAO,IAAI,IAAI;IAwBtB;;;;;;OAMG;YACW,YAAY;IAmF1B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IA6C7B,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,gBAAgB;IASjB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IASnC,UAAU,IAAI,IAAI;IASlB,MAAM,CAAC,KAAK,EAAE;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAmB3D,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAsIT,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;CAGjE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/shared.js
CHANGED
|
@@ -2037,7 +2037,7 @@ var ir = function(e) {
|
|
|
2037
2037
|
url: t,
|
|
2038
2038
|
app: {
|
|
2039
2039
|
name: "odus-checkout",
|
|
2040
|
-
version: "1.
|
|
2040
|
+
version: "1.17.0-beta.1",
|
|
2041
2041
|
environment: e.environment === "test" ? "sandbox" : "production"
|
|
2042
2042
|
},
|
|
2043
2043
|
isolate: !0,
|
|
@@ -5254,6 +5254,6 @@ var mo = (e) => e.replace(/([A-Z])/g, " $1").trim(), ho = Object.fromEntries(Obj
|
|
|
5254
5254
|
setMessage(e) {
|
|
5255
5255
|
return this.messageComponent.setText(e), this;
|
|
5256
5256
|
}
|
|
5257
|
-
};
|
|
5257
|
+
}, Vo = (e) => e.latestTransaction ? e.latestTransaction.status : e.status === "succeeded" ? "authorized" : void 0;
|
|
5258
5258
|
//#endregion
|
|
5259
|
-
export {
|
|
5259
|
+
export { Si as $, za as A, ba as B, io as C, Wa as D, Ya as E, Na as F, $i as G, la as H, Ma as I, Vi as J, Xi as K, Ea as L, La as M, Ia as N, Ha as O, Fa as P, Oi as Q, xa as R, so as S, Xa as T, ra as U, fa as V, ea as W, Ei as X, ki as Y, Di as Z, xo as _, o as _t, Fo as a, hi as at, po as b, jo as c, w as ct, Oo as d, x as dt, Ci as et, Eo as f, c as ft, So as g, i as gt, Co as h, r as ht, Lo as i, Z as it, Ra as j, Va as k, Ao as l, C as lt, wo as m, u as mt, Bo as n, fi as nt, No as o, mi as ot, To as p, n as pt, Hi as q, zo as r, pi as rt, Mo as s, D as st, Vo as t, yi as tt, $ as u, T as ut, bo as v, p as vt, Qa as w, Q as x, co as y, s as yt, ya as z };
|
|
@@ -25,7 +25,8 @@ export interface Payment {
|
|
|
25
25
|
statementDescriptor: string;
|
|
26
26
|
paymentMethod: PaymentMethod;
|
|
27
27
|
latestMessage?: string;
|
|
28
|
-
|
|
28
|
+
/** `null` on a zero-amount payment the API settled without a processor. */
|
|
29
|
+
latestTransaction: Transaction | null;
|
|
29
30
|
action: Action;
|
|
30
31
|
checkoutKey: string;
|
|
31
32
|
transactions: Transaction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payment.type.d.ts","sourceRoot":"","sources":["../../../src/types/payment/Payment.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,GAAG,M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CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,MAAM;IACd,WAAW,EAAE,MAAM,CAAC;IAEpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Payment } from '../../types/payment/Payment.type';
|
|
2
|
+
import { PaymentResult } from '../../types/payment/PaymentResult.type';
|
|
3
|
+
/**
|
|
4
|
+
* The outcome of an authorization, read from the payment's latest transaction.
|
|
5
|
+
*
|
|
6
|
+
* A payment can succeed without one: the API settles a zero-amount payment it
|
|
7
|
+
* has nothing to verify without ever calling a processor. That payment is
|
|
8
|
+
* reported as authorized rather than read through a missing transaction, which
|
|
9
|
+
* used to throw and leave the shopper on a sheet that never finished.
|
|
10
|
+
*/
|
|
11
|
+
export declare const readPaymentResult: (payment: Payment) => PaymentResult | undefined;
|
|
12
|
+
//# sourceMappingURL=paymentResult.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentResult.util.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/paymentResult.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,OAAO,KACf,aAAa,GAAG,SAMlB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odus/checkout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0-beta.1",
|
|
4
4
|
"displayName": "ODUS Checkout SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"odus",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"types": "./dist/elements.d.ts",
|
|
27
27
|
"import": "./dist/elements.es.js",
|
|
28
28
|
"default": "./dist/elements.es.js"
|
|
29
|
+
},
|
|
30
|
+
"./loader": {
|
|
31
|
+
"types": "./dist/loader.d.ts",
|
|
32
|
+
"import": "./dist/loader.es.js",
|
|
33
|
+
"default": "./dist/loader.es.js"
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
"files": [
|