@getopenpay/openpay-js-react 0.0.5-alpha.c8e4dd5 → 0.0.6
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/index.d.ts +1 -1
- package/dist/index.js +63 -62
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare type ElementsFormProps = {
|
|
|
45
45
|
onLoadError?: (message: string) => void;
|
|
46
46
|
onValidationError?: (field: AllFieldNames, errors: string[], elementId?: string) => void;
|
|
47
47
|
onCheckoutStarted?: () => void;
|
|
48
|
-
onCheckoutSuccess?: (invoiceUrls: string[]) => void;
|
|
48
|
+
onCheckoutSuccess?: (invoiceUrls: string[], subscriptionIds: string[]) => void;
|
|
49
49
|
onCheckoutError?: (message: string) => void;
|
|
50
50
|
baseUrl?: string;
|
|
51
51
|
};
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ function Tt(r, e, t) {
|
|
|
38
38
|
var n = r.random || (r.rng || ir)();
|
|
39
39
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, sr(n);
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var x;
|
|
42
42
|
(function(r) {
|
|
43
43
|
r.assertEqual = (s) => s;
|
|
44
44
|
function e(s) {
|
|
@@ -73,7 +73,7 @@ var _;
|
|
|
73
73
|
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
74
74
|
}
|
|
75
75
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
76
|
-
})(
|
|
76
|
+
})(x || (x = {}));
|
|
77
77
|
var nt;
|
|
78
78
|
(function(r) {
|
|
79
79
|
r.mergeShapes = (e, t) => ({
|
|
@@ -82,7 +82,7 @@ var nt;
|
|
|
82
82
|
// second overwrites first
|
|
83
83
|
});
|
|
84
84
|
})(nt || (nt = {}));
|
|
85
|
-
const f =
|
|
85
|
+
const f = x.arrayToEnum([
|
|
86
86
|
"string",
|
|
87
87
|
"nan",
|
|
88
88
|
"number",
|
|
@@ -124,7 +124,7 @@ const f = _.arrayToEnum([
|
|
|
124
124
|
default:
|
|
125
125
|
return f.unknown;
|
|
126
126
|
}
|
|
127
|
-
}, c =
|
|
127
|
+
}, c = x.arrayToEnum([
|
|
128
128
|
"invalid_type",
|
|
129
129
|
"invalid_literal",
|
|
130
130
|
"custom",
|
|
@@ -186,7 +186,7 @@ class Z extends Error {
|
|
|
186
186
|
return this.message;
|
|
187
187
|
}
|
|
188
188
|
get message() {
|
|
189
|
-
return JSON.stringify(this.issues,
|
|
189
|
+
return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
|
|
190
190
|
}
|
|
191
191
|
get isEmpty() {
|
|
192
192
|
return this.issues.length === 0;
|
|
@@ -209,19 +209,19 @@ const le = (r, e) => {
|
|
|
209
209
|
r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
210
210
|
break;
|
|
211
211
|
case c.invalid_literal:
|
|
212
|
-
t = `Invalid literal value, expected ${JSON.stringify(r.expected,
|
|
212
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
|
|
213
213
|
break;
|
|
214
214
|
case c.unrecognized_keys:
|
|
215
|
-
t = `Unrecognized key(s) in object: ${
|
|
215
|
+
t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
|
|
216
216
|
break;
|
|
217
217
|
case c.invalid_union:
|
|
218
218
|
t = "Invalid input";
|
|
219
219
|
break;
|
|
220
220
|
case c.invalid_union_discriminator:
|
|
221
|
-
t = `Invalid discriminator value. Expected ${
|
|
221
|
+
t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
|
|
222
222
|
break;
|
|
223
223
|
case c.invalid_enum_value:
|
|
224
|
-
t = `Invalid enum value. Expected ${
|
|
224
|
+
t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
|
|
225
225
|
break;
|
|
226
226
|
case c.invalid_arguments:
|
|
227
227
|
t = "Invalid function arguments";
|
|
@@ -233,7 +233,7 @@ const le = (r, e) => {
|
|
|
233
233
|
t = "Invalid date";
|
|
234
234
|
break;
|
|
235
235
|
case c.invalid_string:
|
|
236
|
-
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` :
|
|
236
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
237
237
|
break;
|
|
238
238
|
case c.too_small:
|
|
239
239
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
@@ -254,7 +254,7 @@ const le = (r, e) => {
|
|
|
254
254
|
t = "Number must be finite";
|
|
255
255
|
break;
|
|
256
256
|
default:
|
|
257
|
-
t = e.defaultError,
|
|
257
|
+
t = e.defaultError, x.assertNever(r);
|
|
258
258
|
}
|
|
259
259
|
return { message: t };
|
|
260
260
|
};
|
|
@@ -734,7 +734,7 @@ class j extends g {
|
|
|
734
734
|
validation: "base64",
|
|
735
735
|
code: c.invalid_string,
|
|
736
736
|
message: a.message
|
|
737
|
-
}), n.dirty()) :
|
|
737
|
+
}), n.dirty()) : x.assertNever(a);
|
|
738
738
|
return { status: n.value, value: e.data };
|
|
739
739
|
}
|
|
740
740
|
_regex(e, t, n) {
|
|
@@ -972,7 +972,7 @@ class W extends g {
|
|
|
972
972
|
let n;
|
|
973
973
|
const s = new S();
|
|
974
974
|
for (const a of this._def.checks)
|
|
975
|
-
a.kind === "int" ?
|
|
975
|
+
a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
976
976
|
code: c.invalid_type,
|
|
977
977
|
expected: "integer",
|
|
978
978
|
received: "float",
|
|
@@ -998,7 +998,7 @@ class W extends g {
|
|
|
998
998
|
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
999
999
|
code: c.not_finite,
|
|
1000
1000
|
message: a.message
|
|
1001
|
-
}), s.dirty()) :
|
|
1001
|
+
}), s.dirty()) : x.assertNever(a);
|
|
1002
1002
|
return { status: s.value, value: e.data };
|
|
1003
1003
|
}
|
|
1004
1004
|
gte(e, t) {
|
|
@@ -1110,7 +1110,7 @@ class W extends g {
|
|
|
1110
1110
|
return e;
|
|
1111
1111
|
}
|
|
1112
1112
|
get isInt() {
|
|
1113
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1113
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
|
|
1114
1114
|
}
|
|
1115
1115
|
get isFinite() {
|
|
1116
1116
|
let e = null, t = null;
|
|
@@ -1160,7 +1160,7 @@ class J extends g {
|
|
|
1160
1160
|
code: c.not_multiple_of,
|
|
1161
1161
|
multipleOf: a.value,
|
|
1162
1162
|
message: a.message
|
|
1163
|
-
}), s.dirty()) :
|
|
1163
|
+
}), s.dirty()) : x.assertNever(a);
|
|
1164
1164
|
return { status: s.value, value: e.data };
|
|
1165
1165
|
}
|
|
1166
1166
|
gte(e, t) {
|
|
@@ -1307,7 +1307,7 @@ class ee extends g {
|
|
|
1307
1307
|
exact: !1,
|
|
1308
1308
|
maximum: a.value,
|
|
1309
1309
|
type: "date"
|
|
1310
|
-
}), n.dirty()) :
|
|
1310
|
+
}), n.dirty()) : x.assertNever(a);
|
|
1311
1311
|
return {
|
|
1312
1312
|
status: n.value,
|
|
1313
1313
|
value: new Date(e.data.getTime())
|
|
@@ -1554,7 +1554,7 @@ class b extends g {
|
|
|
1554
1554
|
_getCached() {
|
|
1555
1555
|
if (this._cached !== null)
|
|
1556
1556
|
return this._cached;
|
|
1557
|
-
const e = this._def.shape(), t =
|
|
1557
|
+
const e = this._def.shape(), t = x.objectKeys(e);
|
|
1558
1558
|
return this._cached = { shape: e, keys: t };
|
|
1559
1559
|
}
|
|
1560
1560
|
_parse(e) {
|
|
@@ -1761,7 +1761,7 @@ class b extends g {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
pick(e) {
|
|
1763
1763
|
const t = {};
|
|
1764
|
-
return
|
|
1764
|
+
return x.objectKeys(e).forEach((n) => {
|
|
1765
1765
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
1766
1766
|
}), new b({
|
|
1767
1767
|
...this._def,
|
|
@@ -1770,7 +1770,7 @@ class b extends g {
|
|
|
1770
1770
|
}
|
|
1771
1771
|
omit(e) {
|
|
1772
1772
|
const t = {};
|
|
1773
|
-
return
|
|
1773
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
1774
1774
|
e[n] || (t[n] = this.shape[n]);
|
|
1775
1775
|
}), new b({
|
|
1776
1776
|
...this._def,
|
|
@@ -1785,7 +1785,7 @@ class b extends g {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
partial(e) {
|
|
1787
1787
|
const t = {};
|
|
1788
|
-
return
|
|
1788
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
1789
1789
|
const s = this.shape[n];
|
|
1790
1790
|
e && !e[n] ? t[n] = s : t[n] = s.optional();
|
|
1791
1791
|
}), new b({
|
|
@@ -1795,7 +1795,7 @@ class b extends g {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
required(e) {
|
|
1797
1797
|
const t = {};
|
|
1798
|
-
return
|
|
1798
|
+
return x.objectKeys(this.shape).forEach((n) => {
|
|
1799
1799
|
if (e && !e[n])
|
|
1800
1800
|
t[n] = this.shape[n];
|
|
1801
1801
|
else {
|
|
@@ -1810,7 +1810,7 @@ class b extends g {
|
|
|
1810
1810
|
});
|
|
1811
1811
|
}
|
|
1812
1812
|
keyof() {
|
|
1813
|
-
return It(
|
|
1813
|
+
return It(x.objectKeys(this.shape));
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
1816
|
b.create = (r, e) => new b({
|
|
@@ -1907,7 +1907,7 @@ we.create = (r, e) => new we({
|
|
|
1907
1907
|
typeName: m.ZodUnion,
|
|
1908
1908
|
...v(e)
|
|
1909
1909
|
});
|
|
1910
|
-
const V = (r) => r instanceof Se ? V(r.schema) : r instanceof D ? V(r.innerType()) : r instanceof Ce ? [r.value] : r instanceof Y ? r.options : r instanceof Re ?
|
|
1910
|
+
const V = (r) => r instanceof Se ? V(r.schema) : r instanceof D ? V(r.innerType()) : r instanceof Ce ? [r.value] : r instanceof Y ? r.options : r instanceof Re ? x.objectValues(r.enum) : r instanceof Oe ? V(r._def.innerType) : r instanceof be ? [void 0] : r instanceof ke ? [null] : r instanceof U ? [void 0, ...V(r.unwrap())] : r instanceof G ? [null, ...V(r.unwrap())] : r instanceof ot || r instanceof Ze ? V(r.unwrap()) : r instanceof Ie ? V(r._def.innerType) : [];
|
|
1911
1911
|
class We extends g {
|
|
1912
1912
|
_parse(e) {
|
|
1913
1913
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -1975,7 +1975,7 @@ function it(r, e) {
|
|
|
1975
1975
|
if (r === e)
|
|
1976
1976
|
return { valid: !0, data: r };
|
|
1977
1977
|
if (t === f.object && n === f.object) {
|
|
1978
|
-
const s =
|
|
1978
|
+
const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1979
1979
|
for (const o of a) {
|
|
1980
1980
|
const u = it(r[o], e[o]);
|
|
1981
1981
|
if (!u.valid)
|
|
@@ -2388,7 +2388,7 @@ class Y extends g {
|
|
|
2388
2388
|
if (typeof e.data != "string") {
|
|
2389
2389
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2390
2390
|
return l(t, {
|
|
2391
|
-
expected:
|
|
2391
|
+
expected: x.joinValues(n),
|
|
2392
2392
|
received: t.parsedType,
|
|
2393
2393
|
code: c.invalid_type
|
|
2394
2394
|
}), y;
|
|
@@ -2444,17 +2444,17 @@ class Re extends g {
|
|
|
2444
2444
|
super(...arguments), ye.set(this, void 0);
|
|
2445
2445
|
}
|
|
2446
2446
|
_parse(e) {
|
|
2447
|
-
const t =
|
|
2447
|
+
const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2448
2448
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
2449
|
-
const s =
|
|
2449
|
+
const s = x.objectValues(t);
|
|
2450
2450
|
return l(n, {
|
|
2451
|
-
expected:
|
|
2451
|
+
expected: x.joinValues(s),
|
|
2452
2452
|
received: n.parsedType,
|
|
2453
2453
|
code: c.invalid_type
|
|
2454
2454
|
}), y;
|
|
2455
2455
|
}
|
|
2456
|
-
if (ze(this, ye) || St(this, ye, new Set(
|
|
2457
|
-
const s =
|
|
2456
|
+
if (ze(this, ye) || St(this, ye, new Set(x.getValidEnumValues(this._def.values))), !ze(this, ye).has(e.data)) {
|
|
2457
|
+
const s = x.objectValues(t);
|
|
2458
2458
|
return l(n, {
|
|
2459
2459
|
received: n.data,
|
|
2460
2460
|
code: c.invalid_enum_value,
|
|
@@ -2571,7 +2571,7 @@ class D extends g {
|
|
|
2571
2571
|
return { status: t.value, value: o };
|
|
2572
2572
|
} else
|
|
2573
2573
|
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ge(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2574
|
-
|
|
2574
|
+
x.assertNever(s);
|
|
2575
2575
|
}
|
|
2576
2576
|
}
|
|
2577
2577
|
D.create = (r, e, t) => new D({
|
|
@@ -2788,7 +2788,7 @@ const Rr = (r, e = {
|
|
|
2788
2788
|
bigint: (r) => J.create({ ...r, coerce: !0 }),
|
|
2789
2789
|
date: (r) => ee.create({ ...r, coerce: !0 })
|
|
2790
2790
|
}, un = y;
|
|
2791
|
-
var
|
|
2791
|
+
var _ = /* @__PURE__ */ Object.freeze({
|
|
2792
2792
|
__proto__: null,
|
|
2793
2793
|
defaultErrorMap: le,
|
|
2794
2794
|
setErrorMap: dr,
|
|
@@ -2805,7 +2805,7 @@ var x = /* @__PURE__ */ Object.freeze({
|
|
|
2805
2805
|
isValid: ge,
|
|
2806
2806
|
isAsync: _e,
|
|
2807
2807
|
get util() {
|
|
2808
|
-
return
|
|
2808
|
+
return x;
|
|
2809
2809
|
},
|
|
2810
2810
|
get objectUtil() {
|
|
2811
2811
|
return nt;
|
|
@@ -2904,12 +2904,12 @@ var x = /* @__PURE__ */ Object.freeze({
|
|
|
2904
2904
|
quotelessJson: cr,
|
|
2905
2905
|
ZodError: Z
|
|
2906
2906
|
});
|
|
2907
|
-
const N =
|
|
2907
|
+
const N = _.string().trim().min(1, { message: "Cannot be blank" }), q = _.string().trim().optional();
|
|
2908
2908
|
var Pt = /* @__PURE__ */ ((r) => (r.FIRST_NAME = "firstName", r.LAST_NAME = "lastName", r.EMAIL = "email", r.ZIP_CODE = "zipCode", r.CITY = "city", r.STATE = "state", r.COUNTRY = "country", r.ADDRESS = "address", r.PHONE = "phone", r))(Pt || {});
|
|
2909
|
-
const Dt =
|
|
2909
|
+
const Dt = _.nativeEnum(Pt);
|
|
2910
2910
|
var Ut = /* @__PURE__ */ ((r) => (r.CARD_NUMBER = "cardNumber", r.CARD_EXPIRY = "cardExpiry", r.CARD_CVC = "cardCvc", r))(Ut || {});
|
|
2911
|
-
const Lt =
|
|
2912
|
-
|
|
2911
|
+
const Lt = _.nativeEnum(Ut), ln = _.union([Dt, Lt]);
|
|
2912
|
+
_.object({
|
|
2913
2913
|
backgroundColor: q,
|
|
2914
2914
|
color: q,
|
|
2915
2915
|
fontFamily: q,
|
|
@@ -2918,7 +2918,7 @@ x.object({
|
|
|
2918
2918
|
margin: q,
|
|
2919
2919
|
padding: q
|
|
2920
2920
|
});
|
|
2921
|
-
const k =
|
|
2921
|
+
const k = _.enum([
|
|
2922
2922
|
// Element -> Form
|
|
2923
2923
|
"LOADED",
|
|
2924
2924
|
"BLUR",
|
|
@@ -2935,24 +2935,24 @@ const k = x.enum([
|
|
|
2935
2935
|
// Form -> Element
|
|
2936
2936
|
"TOKENIZE",
|
|
2937
2937
|
"CHECKOUT"
|
|
2938
|
-
]), fn = k.extract(["TOKENIZE_STARTED", "CHECKOUT_STARTED"]), hn =
|
|
2938
|
+
]), fn = k.extract(["TOKENIZE_STARTED", "CHECKOUT_STARTED"]), hn = _.object({ type: fn }), pn = k.extract(["BLUR", "FOCUS", "CHANGE"]), mn = _.object({
|
|
2939
2939
|
type: pn,
|
|
2940
2940
|
elementType: Lt
|
|
2941
|
-
}), yn = k.extract(["LOAD_ERROR", "TOKENIZE_ERROR", "CHECKOUT_ERROR"]), vn =
|
|
2941
|
+
}), yn = k.extract(["LOAD_ERROR", "TOKENIZE_ERROR", "CHECKOUT_ERROR"]), vn = _.object({
|
|
2942
2942
|
type: yn,
|
|
2943
2943
|
message: N
|
|
2944
|
-
}), gn = k.extract(["VALIDATION_ERROR"]), _n =
|
|
2944
|
+
}), gn = k.extract(["VALIDATION_ERROR"]), _n = _.object({
|
|
2945
2945
|
type: gn,
|
|
2946
2946
|
elementType: ln,
|
|
2947
|
-
errors:
|
|
2948
|
-
}), xn =
|
|
2949
|
-
type:
|
|
2947
|
+
errors: _.array(_.string())
|
|
2948
|
+
}), xn = _.object({
|
|
2949
|
+
type: _.literal(k.enum.LOADED),
|
|
2950
2950
|
sessionId: N,
|
|
2951
2951
|
height: N,
|
|
2952
|
-
totalAmountAtoms:
|
|
2952
|
+
totalAmountAtoms: _.number(),
|
|
2953
2953
|
currency: q,
|
|
2954
|
-
stripePubKey:
|
|
2955
|
-
}), bn = k.extract(["TOKENIZE", "CHECKOUT"]), Mt =
|
|
2954
|
+
stripePubKey: _.nullable(_.string())
|
|
2955
|
+
}), bn = k.extract(["TOKENIZE", "CHECKOUT"]), Mt = _.object({
|
|
2956
2956
|
type: bn,
|
|
2957
2957
|
sessionId: N,
|
|
2958
2958
|
firstName: N,
|
|
@@ -2960,13 +2960,14 @@ const k = x.enum([
|
|
|
2960
2960
|
email: N,
|
|
2961
2961
|
zipCode: N,
|
|
2962
2962
|
country: N
|
|
2963
|
-
}), kn =
|
|
2964
|
-
type:
|
|
2965
|
-
isReadyForCheckout:
|
|
2966
|
-
}), wn =
|
|
2967
|
-
type:
|
|
2968
|
-
invoiceUrls:
|
|
2969
|
-
|
|
2963
|
+
}), kn = _.object({
|
|
2964
|
+
type: _.literal(k.enum.TOKENIZE_SUCCESS),
|
|
2965
|
+
isReadyForCheckout: _.boolean()
|
|
2966
|
+
}), wn = _.object({
|
|
2967
|
+
type: _.literal(k.enum.CHECKOUT_SUCCESS),
|
|
2968
|
+
invoiceUrls: _.array(_.string()),
|
|
2969
|
+
subscriptionIds: _.array(_.string())
|
|
2970
|
+
}), Tn = _.discriminatedUnion("type", [
|
|
2970
2971
|
hn,
|
|
2971
2972
|
mn,
|
|
2972
2973
|
vn,
|
|
@@ -2975,16 +2976,16 @@ const k = x.enum([
|
|
|
2975
2976
|
Mt,
|
|
2976
2977
|
kn,
|
|
2977
2978
|
wn
|
|
2978
|
-
]), En =
|
|
2979
|
+
]), En = _.object({
|
|
2979
2980
|
payload: Tn,
|
|
2980
2981
|
nonce: N,
|
|
2981
2982
|
formId: N,
|
|
2982
2983
|
elementId: N
|
|
2983
2984
|
});
|
|
2984
|
-
|
|
2985
|
-
isLoading:
|
|
2986
|
-
isAvailable:
|
|
2987
|
-
startFlow:
|
|
2985
|
+
_.object({
|
|
2986
|
+
isLoading: _.boolean(),
|
|
2987
|
+
isAvailable: _.boolean(),
|
|
2988
|
+
startFlow: _.function(_.tuple([]), _.void())
|
|
2988
2989
|
});
|
|
2989
2990
|
const Sn = (r) => {
|
|
2990
2991
|
const e = {};
|
|
@@ -3028,7 +3029,7 @@ const Sn = (r) => {
|
|
|
3028
3029
|
elementId: t
|
|
3029
3030
|
};
|
|
3030
3031
|
r.postMessage(JSON.stringify(a), s);
|
|
3031
|
-
}, On = "https://cde.
|
|
3032
|
+
}, On = "https://cde.getopenpay.com", In = {
|
|
3032
3033
|
usd: "usd",
|
|
3033
3034
|
brl: "brl"
|
|
3034
3035
|
}, Zn = (r) => r.stripePubKey === null ? { isStripeAvailable: !1, stripePubKey: void 0 } : { isStripeAvailable: !0, stripePubKey: r.stripePubKey }, Nn = (r) => {
|
|
@@ -3125,7 +3126,7 @@ const Sn = (r) => {
|
|
|
3125
3126
|
else if (A === k.enum.TOKENIZE_SUCCESS && Ye) {
|
|
3126
3127
|
const oe = ft + 1, Qe = oe === Object.keys(ne).length;
|
|
3127
3128
|
!pt && (Qe || I.isReadyForCheckout) ? (_t(ie, ae, De, Ye, B), mt(!0), ut(void 0)) : ht(oe);
|
|
3128
|
-
} else A === k.enum.CHECKOUT_SUCCESS ? (Ae(!1), ht(0), mt(!1), w && w(I.invoiceUrls)) : A === k.enum.LOAD_ERROR ? u && u(I.message) : A === k.enum.VALIDATION_ERROR ? d && d(I.elementType, I.errors, De) : (A === k.enum.TOKENIZE_ERROR || A === k.enum.CHECKOUT_ERROR) && (Ae(!1), $ && $(I.message));
|
|
3129
|
+
} else A === k.enum.CHECKOUT_SUCCESS ? (Ae(!1), ht(0), mt(!1), w && w(I.invoiceUrls, I.subscriptionIds)) : A === k.enum.LOAD_ERROR ? u && u(I.message) : A === k.enum.VALIDATION_ERROR ? d && d(I.elementType, I.errors, De) : (A === k.enum.TOKENIZE_ERROR || A === k.enum.CHECKOUT_ERROR) && (Ae(!1), $ && $(I.message));
|
|
3129
3130
|
},
|
|
3130
3131
|
[
|
|
3131
3132
|
ae,
|
package/package.json
CHANGED