@paynext/sdk 0.0.73 → 0.0.74
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/README.md +4 -4
- package/dist/index.d.ts +10 -8
- package/dist/index.es.js +127 -119
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -175,7 +175,7 @@ let Wi = class {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
|
-
class
|
|
178
|
+
class ue {
|
|
179
179
|
constructor() {
|
|
180
180
|
_(this, "listeners", []);
|
|
181
181
|
}
|
|
@@ -217,7 +217,7 @@ class Yi {
|
|
|
217
217
|
_(this, "google", null);
|
|
218
218
|
_(this, "threeDs", null);
|
|
219
219
|
_(this, "events", {
|
|
220
|
-
ready: new
|
|
220
|
+
ready: new ue()
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
// is should load
|
|
@@ -342,7 +342,7 @@ function ta(r, t) {
|
|
|
342
342
|
function ra(r, t) {
|
|
343
343
|
return r.at === t.at ? r.value === null ? 1 : t.value === null ? -1 : 0 : r.at - t.at;
|
|
344
344
|
}
|
|
345
|
-
const
|
|
345
|
+
const fe = (r) => !!(r && r.getVelocity), ar = /* @__NO_SIDE_EFFECTS__ */ (r, t, e) => {
|
|
346
346
|
const n = t - r;
|
|
347
347
|
return n === 0 ? 1 : (e - r) / n;
|
|
348
348
|
};
|
|
@@ -438,7 +438,7 @@ function aa(r, i = {}, n, a) {
|
|
|
438
438
|
const x = w + g;
|
|
439
439
|
ea(S, G, C, j, w, x), k = Math.max(P + g, k), f = Math.max(x, f);
|
|
440
440
|
};
|
|
441
|
-
if (
|
|
441
|
+
if (fe(y)) {
|
|
442
442
|
const L = Lr(y, c);
|
|
443
443
|
I(T, N, Pr("default", L));
|
|
444
444
|
} else {
|
|
@@ -849,7 +849,7 @@ function Ea(r, t) {
|
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
function Ca(r) {
|
|
852
|
-
return !!(
|
|
852
|
+
return !!(fe(r) && r.add);
|
|
853
853
|
}
|
|
854
854
|
function _a(r, t) {
|
|
855
855
|
const e = r.getValue("willChange");
|
|
@@ -966,7 +966,7 @@ const jt = {
|
|
|
966
966
|
test: /* @__PURE__ */ ur("hsl", "hue"),
|
|
967
967
|
parse: /* @__PURE__ */ jn("hue", "saturation", "lightness"),
|
|
968
968
|
transform: ({ hue: r, saturation: t, lightness: e, alpha: n = 1 }) => "hsla(" + Math.round(r) + ", " + Ue.transform(rt(t)) + ", " + Ue.transform(rt(e)) + ", " + rt(st.transform(n)) + ")"
|
|
969
|
-
},
|
|
969
|
+
}, pe = {
|
|
970
970
|
test: (r) => Le.test(r) || jt.test(r) || Ve.test(r),
|
|
971
971
|
parse: (r) => Le.test(r) ? Le.parse(r) : Ve.test(r) ? Ve.parse(r) : jt.parse(r),
|
|
972
972
|
transform: (r) => typeof r == "string" ? r : r.hasOwnProperty("red") ? Le.transform(r) : Ve.transform(r)
|
|
@@ -983,7 +983,7 @@ function ot(r) {
|
|
|
983
983
|
var: []
|
|
984
984
|
}, a = [];
|
|
985
985
|
let i = 0;
|
|
986
|
-
const s = t.replace(qa, (l) => (
|
|
986
|
+
const s = t.replace(qa, (l) => (pe.test(l) ? (n.color.push(i), a.push(Kn), e.push(pe.parse(l))) : l.startsWith(Wa) ? (n.var.push(i), a.push(Ha), e.push(l)) : (n.number.push(i), a.push(Bn), e.push(parseFloat(l))), ++i, Vr)).split(Vr);
|
|
987
987
|
return { values: e, split: s, indexes: n, types: a };
|
|
988
988
|
}
|
|
989
989
|
function Hn(r) {
|
|
@@ -996,7 +996,7 @@ function Wn(r) {
|
|
|
996
996
|
for (let o = 0; o < n; o++)
|
|
997
997
|
if (i += t[o], a[o] !== void 0) {
|
|
998
998
|
const s = e[o];
|
|
999
|
-
s === Bn ? i += rt(a[o]) : s === Kn ? i +=
|
|
999
|
+
s === Bn ? i += rt(a[o]) : s === Kn ? i += pe.transform(a[o]) : i += a[o];
|
|
1000
1000
|
}
|
|
1001
1001
|
return i;
|
|
1002
1002
|
};
|
|
@@ -1060,7 +1060,7 @@ function es(r, t) {
|
|
|
1060
1060
|
return (e) => ct(r, t, e);
|
|
1061
1061
|
}
|
|
1062
1062
|
function hr(r) {
|
|
1063
|
-
return typeof r == "number" ? es : typeof r == "string" ? cr(r) ? At :
|
|
1063
|
+
return typeof r == "number" ? es : typeof r == "string" ? cr(r) ? At : pe.test(r) ? Ur : ns : Array.isArray(r) ? qn : typeof r == "object" ? pe.test(r) ? Ur : ts : At;
|
|
1064
1064
|
}
|
|
1065
1065
|
function qn(r, t) {
|
|
1066
1066
|
const e = [...r], n = e.length, a = r.map((i, o) => hr(i)(i, t[o]));
|
|
@@ -2180,9 +2180,9 @@ function po(r) {
|
|
|
2180
2180
|
function ho(r, t, e) {
|
|
2181
2181
|
for (const n in t) {
|
|
2182
2182
|
const a = t[n], i = e[n];
|
|
2183
|
-
if (
|
|
2183
|
+
if (fe(a))
|
|
2184
2184
|
r.addValue(n, a);
|
|
2185
|
-
else if (
|
|
2185
|
+
else if (fe(i))
|
|
2186
2186
|
r.addValue(n, at(a, { owner: r }));
|
|
2187
2187
|
else if (i !== a)
|
|
2188
2188
|
if (r.hasValue(n)) {
|
|
@@ -2200,7 +2200,7 @@ function ho(r, t, e) {
|
|
|
2200
2200
|
const vi = (r) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r), gi = (r) => /^0[^.\s]+$/u.test(r), fo = {
|
|
2201
2201
|
test: (r) => r === "auto",
|
|
2202
2202
|
parse: (r) => r
|
|
2203
|
-
}, yi = (r) => (t) => t.test(r), bi = [We, Z, Ue, ke, ja, za, fo], Xr = (r) => bi.find(yi(r)), mo = [...bi,
|
|
2203
|
+
}, yi = (r) => (t) => t.test(r), bi = [We, Z, Ue, ke, ja, za, fo], Xr = (r) => bi.find(yi(r)), mo = [...bi, pe, qe], vo = (r) => mo.find(yi(r)), go = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2204
2204
|
function yo(r) {
|
|
2205
2205
|
const [t, e] = r.slice(0, -1).split("(");
|
|
2206
2206
|
if (t === "drop-shadow")
|
|
@@ -2288,17 +2288,17 @@ const bo = /\b([a-z-]*)\(.*?\)/gu, er = ee(K({}, qe), {
|
|
|
2288
2288
|
numOctaves: Jr
|
|
2289
2289
|
}), Co = ee(K({}, _r), {
|
|
2290
2290
|
// Color props
|
|
2291
|
-
color:
|
|
2292
|
-
backgroundColor:
|
|
2293
|
-
outlineColor:
|
|
2294
|
-
fill:
|
|
2295
|
-
stroke:
|
|
2291
|
+
color: pe,
|
|
2292
|
+
backgroundColor: pe,
|
|
2293
|
+
outlineColor: pe,
|
|
2294
|
+
fill: pe,
|
|
2295
|
+
stroke: pe,
|
|
2296
2296
|
// Border props
|
|
2297
|
-
borderColor:
|
|
2298
|
-
borderTopColor:
|
|
2299
|
-
borderRightColor:
|
|
2300
|
-
borderBottomColor:
|
|
2301
|
-
borderLeftColor:
|
|
2297
|
+
borderColor: pe,
|
|
2298
|
+
borderTopColor: pe,
|
|
2299
|
+
borderRightColor: pe,
|
|
2300
|
+
borderBottomColor: pe,
|
|
2301
|
+
borderLeftColor: pe,
|
|
2302
2302
|
filter: er,
|
|
2303
2303
|
WebkitFilter: er
|
|
2304
2304
|
}), Ei = (r) => Co[r];
|
|
@@ -2338,7 +2338,7 @@ class _i {
|
|
|
2338
2338
|
const h = this.scrapeMotionValuesFromProps(e, {}, this), { willChange: d } = h, u = Ee(h, ["willChange"]);
|
|
2339
2339
|
for (const p in u) {
|
|
2340
2340
|
const f = u[p];
|
|
2341
|
-
l[p] !== void 0 &&
|
|
2341
|
+
l[p] !== void 0 && fe(f) && f.set(l[p], !1);
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
2344
|
mount(t) {
|
|
@@ -2477,7 +2477,7 @@ class _i {
|
|
|
2477
2477
|
readValue(t, e) {
|
|
2478
2478
|
var a;
|
|
2479
2479
|
let n = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : (a = this.getBaseTargetFromProps(this.props, t)) != null ? a : this.readValueFromInstance(this.current, t, this.options);
|
|
2480
|
-
return n != null && (typeof n == "string" && (vi(n) || gi(n)) ? n = parseFloat(n) : !vo(n) && qe.test(e) && (n = Ci(t, e)), this.setBaseTarget(t,
|
|
2480
|
+
return n != null && (typeof n == "string" && (vi(n) || gi(n)) ? n = parseFloat(n) : !vo(n) && qe.test(e) && (n = Ci(t, e)), this.setBaseTarget(t, fe(n) ? n.get() : n)), fe(n) ? n.get() : n;
|
|
2481
2481
|
}
|
|
2482
2482
|
/**
|
|
2483
2483
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2501,7 +2501,7 @@ class _i {
|
|
|
2501
2501
|
if (e && n !== void 0)
|
|
2502
2502
|
return n;
|
|
2503
2503
|
const a = this.getBaseTargetFromProps(this.props, t);
|
|
2504
|
-
return a !== void 0 && !
|
|
2504
|
+
return a !== void 0 && !fe(a) ? a : this.initialValues[t] !== void 0 && n === void 0 ? void 0 : this.baseTarget[t];
|
|
2505
2505
|
}
|
|
2506
2506
|
on(t, e) {
|
|
2507
2507
|
return this.events[t] || (this.events[t] = new Mn()), this.events[t].add(e);
|
|
@@ -2618,7 +2618,7 @@ class Ti extends _i {
|
|
|
2618
2618
|
handleChildMotionValue() {
|
|
2619
2619
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2620
2620
|
const { children: t } = this.props;
|
|
2621
|
-
|
|
2621
|
+
fe(t) && (this.childSubscription = t.on("change", (e) => {
|
|
2622
2622
|
this.current && (this.current.textContent = `${e}`);
|
|
2623
2623
|
}));
|
|
2624
2624
|
}
|
|
@@ -2682,7 +2682,7 @@ function Oi(r, t, e) {
|
|
|
2682
2682
|
var i;
|
|
2683
2683
|
const { style: n } = r, a = {};
|
|
2684
2684
|
for (const o in n)
|
|
2685
|
-
(
|
|
2685
|
+
(fe(n[o]) || t.style && fe(t.style[o]) || Ro(o, r) || ((i = e == null ? void 0 : e.getValue(o)) == null ? void 0 : i.liveStyle) !== void 0) && (a[o] = n[o]);
|
|
2686
2686
|
return a;
|
|
2687
2687
|
}
|
|
2688
2688
|
function So(r) {
|
|
@@ -2815,7 +2815,7 @@ function Ko(r, t, e, n) {
|
|
|
2815
2815
|
function Ho(r, t, e) {
|
|
2816
2816
|
const n = Oi(r, t, e);
|
|
2817
2817
|
for (const a in r)
|
|
2818
|
-
if (
|
|
2818
|
+
if (fe(r[a]) || fe(t[a])) {
|
|
2819
2819
|
const i = Ke.indexOf(a) !== -1 ? "attr" + a.charAt(0).toUpperCase() + a.substring(1) : a;
|
|
2820
2820
|
n[i] = r[a];
|
|
2821
2821
|
}
|
|
@@ -2885,11 +2885,11 @@ function Yo(r) {
|
|
|
2885
2885
|
e.mount(r), it.set(r, e);
|
|
2886
2886
|
}
|
|
2887
2887
|
function $o(r, t, e) {
|
|
2888
|
-
const n =
|
|
2888
|
+
const n = fe(r) ? r : at(r);
|
|
2889
2889
|
return n.start(pi("", n, t, e)), n.animation;
|
|
2890
2890
|
}
|
|
2891
2891
|
function Qo(r, t) {
|
|
2892
|
-
return
|
|
2892
|
+
return fe(r) || typeof r == "number" || typeof r == "string" && !ir(t);
|
|
2893
2893
|
}
|
|
2894
2894
|
function Li(r, t, e, n) {
|
|
2895
2895
|
const a = [];
|
|
@@ -3043,7 +3043,7 @@ class hl {
|
|
|
3043
3043
|
return this.loader;
|
|
3044
3044
|
}
|
|
3045
3045
|
}
|
|
3046
|
-
const fl = "_checkout_5sq3n_1", ml = "_hidden_5sq3n_7", vl = "_formInitial_5sq3n_11", gl = "_btnsInitial_5sq3n_16",
|
|
3046
|
+
const fl = "_checkout_5sq3n_1", ml = "_hidden_5sq3n_7", vl = "_formInitial_5sq3n_11", gl = "_btnsInitial_5sq3n_16", ve = {
|
|
3047
3047
|
checkout: fl,
|
|
3048
3048
|
hidden: ml,
|
|
3049
3049
|
formInitial: vl,
|
|
@@ -3537,7 +3537,7 @@ const Tt = [
|
|
|
3537
3537
|
error: ce.Invalid
|
|
3538
3538
|
};
|
|
3539
3539
|
};
|
|
3540
|
-
var re = /* @__PURE__ */ ((r) => (r.PAYPAL = "PAYPAL", r.APPLE_PAY = "APPLEPAY", r.GOOGLE_PAY = "GPAY", r.CARD = "CARD", r.VENMO = "VENMO", r))(re || {}), tr = /* @__PURE__ */ ((r) => (r.PENDING = "PENDING", r.FAILED = "FAILED", r.AUTHORIZED = "AUTHORIZED", r.SETTLING = "SETTLING", r.SETTLED = "SETTLED", r.DECLINED = "DECLINED", r.CANCELLED = "CANCELLED", r))(tr || {}),
|
|
3540
|
+
var re = /* @__PURE__ */ ((r) => (r.PAYPAL = "PAYPAL", r.APPLE_PAY = "APPLEPAY", r.GOOGLE_PAY = "GPAY", r.CARD = "CARD", r.VENMO = "VENMO", r))(re || {}), tr = /* @__PURE__ */ ((r) => (r.PENDING = "PENDING", r.FAILED = "FAILED", r.AUTHORIZED = "AUTHORIZED", r.SETTLING = "SETTLING", r.SETTLED = "SETTLED", r.DECLINED = "DECLINED", r.CANCELLED = "CANCELLED", r))(tr || {}), de = /* @__PURE__ */ ((r) => (r.INSUFFICIENT_FUNDS = "insufficient_funds", r.AUTHENTICATION_REQUIRED = "authentication_required", r.CARD_ISSUER_DECLINE = "card_issuer_decline", r.GENERIC_DECLINE = "generic_decline", r.WITHDRAWAL_LIMIT_EXCEEDED = "withdrawal_limit_exceeded", r.DO_NOT_HONOR = "do_not_honor", r.EXPIRED_CARD = "expired_card", r.SUSPECTED_FRAUD = "suspected_fraud", r.INCORRECT_CVC = "incorrect_cvc", r.INVALID_CARD_NUMBER = "invalid_card_number", r.ISSUER_UNAVAILABLE = "issuer_unavailable", r.CARD_LOST_OR_STOLEN = "card_lost_or_stolen", r.CARD_DECLINED = "card_declined", r))(de || {});
|
|
3541
3541
|
const Tr = (r = "sandbox") => ({
|
|
3542
3542
|
develop: "https://dev-api.paynext.com",
|
|
3543
3543
|
staging: "https://staging-api.paynext.com",
|
|
@@ -4199,19 +4199,19 @@ const ec = [
|
|
|
4199
4199
|
const t = r.errors;
|
|
4200
4200
|
return {
|
|
4201
4201
|
// DeclineCode enum mapping (keys are API decline_code values)
|
|
4202
|
-
[
|
|
4203
|
-
[
|
|
4204
|
-
[
|
|
4205
|
-
[
|
|
4206
|
-
[
|
|
4207
|
-
[
|
|
4208
|
-
[
|
|
4209
|
-
[
|
|
4210
|
-
[
|
|
4211
|
-
[
|
|
4212
|
-
[
|
|
4213
|
-
[
|
|
4214
|
-
[
|
|
4202
|
+
[de.INSUFFICIENT_FUNDS]: t == null ? void 0 : t.insufficientFunds,
|
|
4203
|
+
[de.AUTHENTICATION_REQUIRED]: t == null ? void 0 : t.cardholderAuthenticationRequired,
|
|
4204
|
+
[de.CARD_ISSUER_DECLINE]: t == null ? void 0 : t.declined,
|
|
4205
|
+
[de.GENERIC_DECLINE]: t == null ? void 0 : t.declined,
|
|
4206
|
+
[de.WITHDRAWAL_LIMIT_EXCEEDED]: t == null ? void 0 : t.limitExceeded,
|
|
4207
|
+
[de.DO_NOT_HONOR]: t == null ? void 0 : t.doNotHonor,
|
|
4208
|
+
[de.EXPIRED_CARD]: t == null ? void 0 : t.expiredCard,
|
|
4209
|
+
[de.SUSPECTED_FRAUD]: t == null ? void 0 : t.processorDeclinedFraudSuspected,
|
|
4210
|
+
[de.INCORRECT_CVC]: (t == null ? void 0 : t.invalidSecurePaymentData) || (t == null ? void 0 : t.invalidCreditCardNumber),
|
|
4211
|
+
[de.INVALID_CARD_NUMBER]: t == null ? void 0 : t.invalidCreditCardNumber,
|
|
4212
|
+
[de.ISSUER_UNAVAILABLE]: t == null ? void 0 : t.offlineIssuerDeclined,
|
|
4213
|
+
[de.CARD_LOST_OR_STOLEN]: t == null ? void 0 : t.cardReportedAsLostOrStolen,
|
|
4214
|
+
[de.CARD_DECLINED]: t == null ? void 0 : t.declined,
|
|
4215
4215
|
errorText: t == null ? void 0 : t.errorText,
|
|
4216
4216
|
"Frame closed before tokenization could occur.": t == null ? void 0 : t.venmoClosed,
|
|
4217
4217
|
"Window is closed, can not determine type": t == null ? void 0 : t.paypalClosed,
|
|
@@ -4231,7 +4231,7 @@ class tc {
|
|
|
4231
4231
|
constructor(t) {
|
|
4232
4232
|
_(this, "element");
|
|
4233
4233
|
_(this, "events", {
|
|
4234
|
-
ready: new
|
|
4234
|
+
ready: new ue()
|
|
4235
4235
|
});
|
|
4236
4236
|
_(this, "ev");
|
|
4237
4237
|
_(this, "customButtonStyles");
|
|
@@ -4303,7 +4303,7 @@ const rc = [
|
|
|
4303
4303
|
open: { y: 0, opacity: 1 },
|
|
4304
4304
|
close: { y: -100, opacity: 0 },
|
|
4305
4305
|
transition: { duration: 0.25, type: "spring", bounce: 0 }
|
|
4306
|
-
},
|
|
4306
|
+
}, he = {
|
|
4307
4307
|
open: { y: 0, opacity: 1 },
|
|
4308
4308
|
close: { y: 15, opacity: 0 },
|
|
4309
4309
|
transition: { duration: 0.25, type: "spring", bounce: 0 }
|
|
@@ -4319,7 +4319,7 @@ class ac {
|
|
|
4319
4319
|
constructor(t) {
|
|
4320
4320
|
_(this, "element");
|
|
4321
4321
|
_(this, "events", {
|
|
4322
|
-
ready: new
|
|
4322
|
+
ready: new ue()
|
|
4323
4323
|
});
|
|
4324
4324
|
_(this, "ev");
|
|
4325
4325
|
_(this, "customButtonStyles");
|
|
@@ -4382,7 +4382,7 @@ class lc {
|
|
|
4382
4382
|
constructor(t) {
|
|
4383
4383
|
_(this, "element");
|
|
4384
4384
|
_(this, "events", {
|
|
4385
|
-
ready: new
|
|
4385
|
+
ready: new ue()
|
|
4386
4386
|
});
|
|
4387
4387
|
_(this, "paypal");
|
|
4388
4388
|
_(this, "customButtonStyles");
|
|
@@ -4540,7 +4540,7 @@ class yc {
|
|
|
4540
4540
|
_(this, "container");
|
|
4541
4541
|
_(this, "venmoButton");
|
|
4542
4542
|
_(this, "events", {
|
|
4543
|
-
ready: new
|
|
4543
|
+
ready: new ue()
|
|
4544
4544
|
});
|
|
4545
4545
|
_(this, "braintree");
|
|
4546
4546
|
_(this, "error");
|
|
@@ -4555,17 +4555,17 @@ class yc {
|
|
|
4555
4555
|
var n;
|
|
4556
4556
|
if (!this.config) return !1;
|
|
4557
4557
|
const e = this.config.state.transaction.getState();
|
|
4558
|
-
if (
|
|
4559
|
-
return
|
|
4558
|
+
if (!e || Object.keys(e).length === 0)
|
|
4559
|
+
return !1;
|
|
4560
4560
|
try {
|
|
4561
4561
|
return yield this.braintree.init({
|
|
4562
4562
|
authorization: ((n = e == null ? void 0 : e.brain_tree_info) == null ? void 0 : n.client_token) || ""
|
|
4563
4563
|
}), yield this.braintree.createVenmo({
|
|
4564
4564
|
// ToDo: update before release
|
|
4565
4565
|
// deepLinkReturnUrl: checkout?.returnUrl,
|
|
4566
|
-
}), this.braintree.isBrowserSupported() ? (this.displayVenmoButton(t), this.braintree.hasTokenizationResult() ? (yield this.handleExistingTokenization(t), !1) : (this.venmoButton.classList.remove(bt.hidden), this.container.append(this.error.render()), this.isInitialized = !0, this.events.ready.emit(), !0)) : (
|
|
4566
|
+
}), this.braintree.isBrowserSupported() ? (this.displayVenmoButton(t), this.braintree.hasTokenizationResult() ? (yield this.handleExistingTokenization(t), !1) : (this.venmoButton.classList.remove(bt.hidden), this.container.append(this.error.render()), this.isInitialized = !0, this.events.ready.emit(), !0)) : (this.handleVenmoError(new Error("Browser does not support Venmo")), !1);
|
|
4567
4567
|
} catch (a) {
|
|
4568
|
-
return
|
|
4568
|
+
return this.handleVenmoError(a), !1;
|
|
4569
4569
|
}
|
|
4570
4570
|
});
|
|
4571
4571
|
}
|
|
@@ -4599,13 +4599,12 @@ class yc {
|
|
|
4599
4599
|
// handle successful venmo payment
|
|
4600
4600
|
handleVenmoSuccess(t, e) {
|
|
4601
4601
|
var n;
|
|
4602
|
-
|
|
4602
|
+
this.error.render().style.display = "none", (n = e.onSuccess) == null || n.call(e, t);
|
|
4603
4603
|
}
|
|
4604
4604
|
// handle venmo errors
|
|
4605
4605
|
handleVenmoError(t, e) {
|
|
4606
4606
|
var s, l;
|
|
4607
|
-
if (
|
|
4608
|
-
return;
|
|
4607
|
+
if (!this.isInitialized) return;
|
|
4609
4608
|
const n = this.config.state.translate.messages(), a = je(t, n), i = xe(n)[a], o = ((s = n.errors) == null ? void 0 : s.errorText) || "Error";
|
|
4610
4609
|
this.error.setMessage(`Venmo ${o.toLowerCase()}: ${i != null ? i : a}`), this.error.render().style.display = "", (l = e == null ? void 0 : e.onError) == null || l.call(e, t);
|
|
4611
4610
|
}
|
|
@@ -4615,10 +4614,7 @@ class yc {
|
|
|
4615
4614
|
}
|
|
4616
4615
|
showExternalError(t) {
|
|
4617
4616
|
var i;
|
|
4618
|
-
if (!this.isInitialized)
|
|
4619
|
-
console.error("Venmo error:", t);
|
|
4620
|
-
return;
|
|
4621
|
-
}
|
|
4617
|
+
if (!this.isInitialized) return;
|
|
4622
4618
|
const e = this.config.state.translate.messages(), n = xe(e)[t], a = ((i = e.errors) == null ? void 0 : i.errorText) || "Error";
|
|
4623
4619
|
this.error.setMessage(`Venmo ${a.toLowerCase()}: ${n != null ? n : t}`), this.error.render().style.display = "";
|
|
4624
4620
|
}
|
|
@@ -4641,11 +4637,11 @@ class bc {
|
|
|
4641
4637
|
_(this, "braintree");
|
|
4642
4638
|
_(this, "lastInteracted", null);
|
|
4643
4639
|
_(this, "events", {
|
|
4644
|
-
ready: new
|
|
4645
|
-
open: new
|
|
4646
|
-
error: new
|
|
4647
|
-
cancel: new
|
|
4648
|
-
success: new
|
|
4640
|
+
ready: new ue(),
|
|
4641
|
+
open: new ue(),
|
|
4642
|
+
error: new ue(),
|
|
4643
|
+
cancel: new ue(),
|
|
4644
|
+
success: new ue()
|
|
4649
4645
|
});
|
|
4650
4646
|
this.config = t, this.buttons = document.createElement("div"), this.buttons.classList.add(Pt.buttons, Pt.hidden);
|
|
4651
4647
|
}
|
|
@@ -4924,7 +4920,7 @@ class Bc {
|
|
|
4924
4920
|
_(this, "isDisabled", !1);
|
|
4925
4921
|
_(this, "isChanged", !1);
|
|
4926
4922
|
_(this, "events", {
|
|
4927
|
-
change: new
|
|
4923
|
+
change: new ue()
|
|
4928
4924
|
});
|
|
4929
4925
|
var a, i, o, s, l, c, d, u, h;
|
|
4930
4926
|
const n = t.messages();
|
|
@@ -4948,10 +4944,10 @@ class Bc {
|
|
|
4948
4944
|
toggleLabelError(t) {
|
|
4949
4945
|
return q(this, null, function* () {
|
|
4950
4946
|
if (t) {
|
|
4951
|
-
this.inputContainer.classList.add(oe.errorInput), this.endContent.classList.remove(oe.hidden), this.labelError.classList.remove(oe.hidden), yield le(this.labelError,
|
|
4947
|
+
this.inputContainer.classList.add(oe.errorInput), this.endContent.classList.remove(oe.hidden), this.labelError.classList.remove(oe.hidden), yield le(this.labelError, he.open, he.transition);
|
|
4952
4948
|
return;
|
|
4953
4949
|
}
|
|
4954
|
-
this.inputContainer.classList.remove(oe.errorInput), this.endContent.classList.add(oe.hidden), yield le(this.labelError,
|
|
4950
|
+
this.inputContainer.classList.remove(oe.errorInput), this.endContent.classList.add(oe.hidden), yield le(this.labelError, he.close, he.transition), this.labelError.classList.add(oe.hidden);
|
|
4955
4951
|
});
|
|
4956
4952
|
}
|
|
4957
4953
|
addEventListener(t, e) {
|
|
@@ -5340,7 +5336,7 @@ class ld {
|
|
|
5340
5336
|
_(this, "isDisabled", !1);
|
|
5341
5337
|
_(this, "isChanged", !1);
|
|
5342
5338
|
_(this, "events", {
|
|
5343
|
-
change: new
|
|
5339
|
+
change: new ue()
|
|
5344
5340
|
});
|
|
5345
5341
|
var a, i, o, s, l, c, d, u, h;
|
|
5346
5342
|
this.translate = t;
|
|
@@ -5391,10 +5387,10 @@ ${m}::-ms-input-placeholder{${f}}
|
|
|
5391
5387
|
toggleLabelError(t) {
|
|
5392
5388
|
return q(this, null, function* () {
|
|
5393
5389
|
if (t) {
|
|
5394
|
-
this.inputContainer.classList.add(ie.errorInput), this.labelError.classList.remove(ie.hidden), yield le(this.labelError,
|
|
5390
|
+
this.inputContainer.classList.add(ie.errorInput), this.labelError.classList.remove(ie.hidden), yield le(this.labelError, he.open, he.transition);
|
|
5395
5391
|
return;
|
|
5396
5392
|
}
|
|
5397
|
-
yield le(this.labelError,
|
|
5393
|
+
yield le(this.labelError, he.close, he.transition), this.labelError.classList.add(ie.hidden);
|
|
5398
5394
|
});
|
|
5399
5395
|
}
|
|
5400
5396
|
toggleErrorMessage(t) {
|
|
@@ -5528,8 +5524,8 @@ class Cd {
|
|
|
5528
5524
|
_(this, "isCvcRequired", !1);
|
|
5529
5525
|
_(this, "isCvcChanged", !1);
|
|
5530
5526
|
_(this, "events", {
|
|
5531
|
-
expiryChange: new
|
|
5532
|
-
cvcChange: new
|
|
5527
|
+
expiryChange: new ue(),
|
|
5528
|
+
cvcChange: new ue()
|
|
5533
5529
|
});
|
|
5534
5530
|
var o, s, l, c, d, u, h, p, f, m, v, y, T, N, k, I, L;
|
|
5535
5531
|
this.translate = t;
|
|
@@ -5620,10 +5616,10 @@ class Cd {
|
|
|
5620
5616
|
toggleCvcLabelError(t) {
|
|
5621
5617
|
return q(this, null, function* () {
|
|
5622
5618
|
if (t) {
|
|
5623
|
-
this.cvcInputContainer.classList.add(Q.errorInput), this.cvcLabelError.classList.remove(Q.hidden), yield le(this.cvcLabelError,
|
|
5619
|
+
this.cvcInputContainer.classList.add(Q.errorInput), this.cvcLabelError.classList.remove(Q.hidden), yield le(this.cvcLabelError, he.open, he.transition);
|
|
5624
5620
|
return;
|
|
5625
5621
|
}
|
|
5626
|
-
yield le(this.cvcLabelError,
|
|
5622
|
+
yield le(this.cvcLabelError, he.close, he.transition), this.cvcLabelError.classList.add(Q.hidden);
|
|
5627
5623
|
});
|
|
5628
5624
|
}
|
|
5629
5625
|
toggleCvcErrorMessage(t) {
|
|
@@ -5667,10 +5663,10 @@ class Cd {
|
|
|
5667
5663
|
toggleExpiryLabelError(t) {
|
|
5668
5664
|
return q(this, null, function* () {
|
|
5669
5665
|
if (t) {
|
|
5670
|
-
this.expiryInputContainer.classList.add(Q.errorInput), this.expiryLabelError.classList.remove(Q.hidden), yield le(this.expiryLabelError,
|
|
5666
|
+
this.expiryInputContainer.classList.add(Q.errorInput), this.expiryLabelError.classList.remove(Q.hidden), yield le(this.expiryLabelError, he.open, he.transition);
|
|
5671
5667
|
return;
|
|
5672
5668
|
}
|
|
5673
|
-
yield le(this.expiryLabelError,
|
|
5669
|
+
yield le(this.expiryLabelError, he.close, he.transition), this.expiryLabelError.classList.add(Q.hidden);
|
|
5674
5670
|
});
|
|
5675
5671
|
}
|
|
5676
5672
|
toggleExpiryErrorMessage(t) {
|
|
@@ -5723,8 +5719,8 @@ class _d {
|
|
|
5723
5719
|
_(this, "translate");
|
|
5724
5720
|
_(this, "isBackVisible", !0);
|
|
5725
5721
|
_(this, "events", {
|
|
5726
|
-
submit: new
|
|
5727
|
-
close: new
|
|
5722
|
+
submit: new ue(),
|
|
5723
|
+
close: new ue()
|
|
5728
5724
|
});
|
|
5729
5725
|
const i = n.getState();
|
|
5730
5726
|
this.translate = t, this.element = document.createElement("form"), this.error = new _e(t), this.submit = new kc(t, i.SubmitButton), this.back = new Ac(), this.number = new ld(t, i.Input), this.name = new Bc(t, i.Input), this.cardSecurity = new Cd(t, i.Input), this.error.addClassName(Ae.hidden), this.element.classList.add(Ae.cardForm, e || "");
|
|
@@ -5846,23 +5842,27 @@ class Nd {
|
|
|
5846
5842
|
_(this, "form");
|
|
5847
5843
|
this.config = t, this.buttons = new bc(t), this.form = new _d({
|
|
5848
5844
|
translate: t.state.translate,
|
|
5849
|
-
className:
|
|
5845
|
+
className: ve.hidden,
|
|
5850
5846
|
stylesState: t.state.styles,
|
|
5851
5847
|
isDefaultVariant: t.state.checkout.getState().variant === "default"
|
|
5852
|
-
}), this.success = new Id(t.state.translate), this.success.addClassName(
|
|
5848
|
+
}), this.success = new Id(t.state.translate), this.success.addClassName(ve.hidden), this.container.append(this.loader.render(), this.buttons.render(), this.form.render()), this.checkout = document.createElement("div"), this.checkout.classList.add(ve.checkout), this.checkout.append(this.container, this.success.render());
|
|
5853
5849
|
}
|
|
5854
5850
|
// init
|
|
5855
5851
|
init() {
|
|
5856
5852
|
return q(this, null, function* () {
|
|
5857
5853
|
this.buttons.addEventListener("ready", () => q(this, null, function* () {
|
|
5858
|
-
this.loader.setClassName(
|
|
5854
|
+
this.loader.setClassName(ve.hidden);
|
|
5859
5855
|
const { variant: t } = this.config.state.checkout.getState();
|
|
5860
|
-
this.form.setDefaultVariant(t === "default"), this.buttons.showButton(), t === "default" && (this.form.element.classList.remove(
|
|
5856
|
+
this.form.setDefaultVariant(t === "default"), this.buttons.showButton(), t === "default" && (this.form.element.classList.remove(ve.hidden), this.isFormOpen = !0);
|
|
5861
5857
|
})), this.buttons.addEventListener("open", () => q(this, null, function* () {
|
|
5862
|
-
this.isLoading || (this.hideError(), yield le(this.buttons.buttons, yt.close, yt.transition), this.buttons.buttons.classList.add(
|
|
5858
|
+
this.isLoading || (this.hideError(), yield le(this.buttons.buttons, yt.close, yt.transition), this.buttons.buttons.classList.add(ve.hidden), this.form.element.classList.add(ve.formInitial), this.form.element.classList.remove(ve.hidden), yield le(this.form.element, Me.open, Me.transition), this.isFormOpen = !0);
|
|
5863
5859
|
})), this.buttons.addEventListener("error", (t) => {
|
|
5864
5860
|
const { onCheckoutFail: e } = this.config.state.checkout.getState(), n = this.config.state.translate.messages(), a = je(t, n);
|
|
5865
|
-
this.buttons.showExternalError(a), e == null || e(
|
|
5861
|
+
this.buttons.showExternalError(a), e == null || e({
|
|
5862
|
+
advice_code: "try_again_later",
|
|
5863
|
+
decline_code: de.GENERIC_DECLINE,
|
|
5864
|
+
message: t.message || t
|
|
5865
|
+
});
|
|
5866
5866
|
}), this.buttons.addEventListener("success", (t) => {
|
|
5867
5867
|
const { clientToken: e } = this.config.state.checkout.getState();
|
|
5868
5868
|
switch (t.type) {
|
|
@@ -5880,9 +5880,9 @@ class Nd {
|
|
|
5880
5880
|
}
|
|
5881
5881
|
}), this.form.addEventListener("close", () => q(this, null, function* () {
|
|
5882
5882
|
if (this.isLoading) return;
|
|
5883
|
-
this.hideError(), yield le(this.form.element, Me.close, Me.transition), this.form.element.classList.add(
|
|
5883
|
+
this.hideError(), yield le(this.form.element, Me.close, Me.transition), this.form.element.classList.add(ve.hidden);
|
|
5884
5884
|
const { variant: t } = this.config.state.checkout.getState();
|
|
5885
|
-
t !== "default" && (this.buttons.buttons.classList.add(
|
|
5885
|
+
t !== "default" && (this.buttons.buttons.classList.add(ve.btnsInitial), this.buttons.buttons.classList.remove(ve.hidden), yield le(this.buttons.buttons, yt.open, yt.transition)), this.isFormOpen = !1;
|
|
5886
5886
|
})), this.form.addEventListener("submit", (t) => q(this, null, function* () {
|
|
5887
5887
|
if (this.isLoading || (this.form.touchSubmit(), !this.form.validate())) return;
|
|
5888
5888
|
const n = t.number.replace(/\D/g, ""), a = this.config.state.checkout.getState(), i = this.config.service.ev.getEv(), [o, s] = yield Promise.all([i.encrypt(n), i.encrypt(t.cvc)]), [l, c] = t.expiry.split("/");
|
|
@@ -5910,47 +5910,55 @@ class Nd {
|
|
|
5910
5910
|
handleError(t) {
|
|
5911
5911
|
var i;
|
|
5912
5912
|
const e = this.config.state.checkout.getState();
|
|
5913
|
-
console.error(t);
|
|
5913
|
+
console.error("Error: ", t);
|
|
5914
5914
|
const n = this.config.state.translate.messages(), a = je(t, n);
|
|
5915
5915
|
this.buttons.showExternalError(a), this.showError(a), (i = e.onCheckoutFail) == null || i.call(e, t), this.setLoading(!1);
|
|
5916
5916
|
}
|
|
5917
5917
|
// handle success
|
|
5918
5918
|
handleSuccess(t) {
|
|
5919
5919
|
return q(this, null, function* () {
|
|
5920
|
-
var a, i
|
|
5920
|
+
var a, i;
|
|
5921
5921
|
if (this.isLoading) return;
|
|
5922
5922
|
this.hideError(), this.setLoading(!0);
|
|
5923
5923
|
const e = this.config.state.checkout.getState(), n = this.config.state.translate.messages();
|
|
5924
5924
|
try {
|
|
5925
|
-
const
|
|
5926
|
-
if (
|
|
5927
|
-
throw new Error(((a =
|
|
5928
|
-
if (
|
|
5925
|
+
const o = yield zl(t, e.environment, e.apiVersion);
|
|
5926
|
+
if (o.error)
|
|
5927
|
+
throw new Error(((a = o.error) == null ? void 0 : a.message) || n.status.error);
|
|
5928
|
+
if (o.three_ds_session_id) {
|
|
5929
5929
|
yield this.config.service.ev.initThreeDs({
|
|
5930
|
-
threeDsId:
|
|
5930
|
+
threeDsId: o.three_ds_session_id,
|
|
5931
5931
|
onSuccess: () => {
|
|
5932
|
-
this.setLoading(!1), this.handleSuccess(ee(K({}, t), { threeDsSessionId:
|
|
5932
|
+
this.setLoading(!1), this.handleSuccess(ee(K({}, t), { threeDsSessionId: o.three_ds_session_id }));
|
|
5933
5933
|
},
|
|
5934
5934
|
onError: () => {
|
|
5935
|
-
this.handleError(
|
|
5935
|
+
this.handleError({
|
|
5936
|
+
advice_code: "try_again_later",
|
|
5937
|
+
decline_code: de.GENERIC_DECLINE,
|
|
5938
|
+
message: "Three DS Error"
|
|
5939
|
+
});
|
|
5936
5940
|
}
|
|
5937
5941
|
});
|
|
5938
5942
|
return;
|
|
5939
5943
|
}
|
|
5940
|
-
if (
|
|
5941
|
-
this.handleError(
|
|
5944
|
+
if (o.payment_status === tr.FAILED || o.payment_status === tr.DECLINED) {
|
|
5945
|
+
this.handleError(o.status_reason.status_reason);
|
|
5942
5946
|
return;
|
|
5943
5947
|
}
|
|
5944
|
-
yield this.showSuccess(), (
|
|
5945
|
-
} catch (
|
|
5946
|
-
this.handleError(
|
|
5948
|
+
yield this.showSuccess(), (i = e.onCheckoutComplete) == null || i.call(e, o), this.setLoading(!1);
|
|
5949
|
+
} catch (o) {
|
|
5950
|
+
this.handleError({
|
|
5951
|
+
advice_code: "try_again_later",
|
|
5952
|
+
decline_code: de.GENERIC_DECLINE,
|
|
5953
|
+
message: o.message || o
|
|
5954
|
+
});
|
|
5947
5955
|
}
|
|
5948
5956
|
});
|
|
5949
5957
|
}
|
|
5950
5958
|
// show success
|
|
5951
5959
|
showSuccess() {
|
|
5952
5960
|
return q(this, null, function* () {
|
|
5953
|
-
this.container.classList.add(
|
|
5961
|
+
this.container.classList.add(ve.hidden), this.success.removeClassName(ve.hidden), yield le(this.success.element, Me.open, Me.transition);
|
|
5954
5962
|
});
|
|
5955
5963
|
}
|
|
5956
5964
|
// hide error
|
|
@@ -5963,7 +5971,7 @@ class Nd {
|
|
|
5963
5971
|
}
|
|
5964
5972
|
// set loading
|
|
5965
5973
|
setLoading(t) {
|
|
5966
|
-
this.isLoading = t, this.form.setLoading(t), this.loader.setClassName(!t || this.isFormOpen ?
|
|
5974
|
+
this.isLoading = t, this.form.setLoading(t), this.loader.setClassName(!t || this.isFormOpen ? ve.hidden : "");
|
|
5967
5975
|
}
|
|
5968
5976
|
// render
|
|
5969
5977
|
render() {
|
|
@@ -6002,7 +6010,7 @@ class It {
|
|
|
6002
6010
|
constructor(t) {
|
|
6003
6011
|
_(this, "initialState");
|
|
6004
6012
|
_(this, "state");
|
|
6005
|
-
_(this, "observer", new
|
|
6013
|
+
_(this, "observer", new ue());
|
|
6006
6014
|
this.initialState = t, this.state = t;
|
|
6007
6015
|
}
|
|
6008
6016
|
getState() {
|
|
@@ -8460,7 +8468,7 @@ const Sd = {
|
|
|
8460
8468
|
const r = navigator == null ? void 0 : navigator.language.split("-")[0];
|
|
8461
8469
|
return rr[r] || rr.en;
|
|
8462
8470
|
}, Cn = (r, t = {}) => {
|
|
8463
|
-
var i, o, s, l, c, d, u, h, p, f, m, v, y, T, N, k, I, L, O, S, U, W, G, F, j, B, J, D, Y, H, C, g, P, V, b, w, E, x, M, A, z, $, ne, R, te,
|
|
8471
|
+
var i, o, s, l, c, d, u, h, p, f, m, v, y, T, N, k, I, L, O, S, U, W, G, F, j, B, J, D, Y, H, C, g, P, V, b, w, E, x, M, A, z, $, ne, R, te, me, wr, Ir;
|
|
8464
8472
|
if (!r) return nr();
|
|
8465
8473
|
const e = rr[r] || nr(), n = Object.keys(Di.errors || {}).reduce((Nr, Fi) => (Nr[Fi] = e.status.error, Nr), {}), a = K(K(K({}, n), e.errors || {}), t.errors || {});
|
|
8466
8474
|
return {
|
|
@@ -8502,7 +8510,7 @@ const Sd = {
|
|
|
8502
8510
|
button: ((R = (ne = t == null ? void 0 : t.card) == null ? void 0 : ne.pay) == null ? void 0 : R.button) || e.card.pay.button
|
|
8503
8511
|
},
|
|
8504
8512
|
compact: {
|
|
8505
|
-
button: ((
|
|
8513
|
+
button: ((me = (te = t == null ? void 0 : t.card) == null ? void 0 : te.compact) == null ? void 0 : me.button) || e.card.compact.button
|
|
8506
8514
|
}
|
|
8507
8515
|
},
|
|
8508
8516
|
status: {
|
|
@@ -8864,15 +8872,15 @@ function Ou() {
|
|
|
8864
8872
|
function $(te) {
|
|
8865
8873
|
try {
|
|
8866
8874
|
R(x.next(te));
|
|
8867
|
-
} catch (
|
|
8868
|
-
z(
|
|
8875
|
+
} catch (me) {
|
|
8876
|
+
z(me);
|
|
8869
8877
|
}
|
|
8870
8878
|
}
|
|
8871
8879
|
function ne(te) {
|
|
8872
8880
|
try {
|
|
8873
8881
|
R(x.throw(te));
|
|
8874
|
-
} catch (
|
|
8875
|
-
z(
|
|
8882
|
+
} catch (me) {
|
|
8883
|
+
z(me);
|
|
8876
8884
|
}
|
|
8877
8885
|
}
|
|
8878
8886
|
function R(te) {
|
|
@@ -10533,15 +10541,15 @@ function Lu() {
|
|
|
10533
10541
|
function $(te) {
|
|
10534
10542
|
try {
|
|
10535
10543
|
R(x.next(te));
|
|
10536
|
-
} catch (
|
|
10537
|
-
z(
|
|
10544
|
+
} catch (me) {
|
|
10545
|
+
z(me);
|
|
10538
10546
|
}
|
|
10539
10547
|
}
|
|
10540
10548
|
function ne(te) {
|
|
10541
10549
|
try {
|
|
10542
10550
|
R(x.throw(te));
|
|
10543
|
-
} catch (
|
|
10544
|
-
z(
|
|
10551
|
+
} catch (me) {
|
|
10552
|
+
z(me);
|
|
10545
10553
|
}
|
|
10546
10554
|
}
|
|
10547
10555
|
function R(te) {
|
|
@@ -11450,15 +11458,15 @@ function Su() {
|
|
|
11450
11458
|
function $(te) {
|
|
11451
11459
|
try {
|
|
11452
11460
|
R(x.next(te));
|
|
11453
|
-
} catch (
|
|
11454
|
-
z(
|
|
11461
|
+
} catch (me) {
|
|
11462
|
+
z(me);
|
|
11455
11463
|
}
|
|
11456
11464
|
}
|
|
11457
11465
|
function ne(te) {
|
|
11458
11466
|
try {
|
|
11459
11467
|
R(x.throw(te));
|
|
11460
|
-
} catch (
|
|
11461
|
-
z(
|
|
11468
|
+
} catch (me) {
|
|
11469
|
+
z(me);
|
|
11462
11470
|
}
|
|
11463
11471
|
}
|
|
11464
11472
|
function R(te) {
|