@lydianpay/sdk-web 3.18.1 → 3.18.2
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/chunks/{browser-BUlIfLHb.js → browser-ByUw6qxL.js} +1 -1
- package/dist/chunks/{connect-multichain-DVWN1OPV.js → connect-multichain-B5TudJIg.js} +9 -9
- package/dist/chunks/{dist-DXXffMpA.js → dist-CgyqdZZP.js} +3 -3
- package/dist/chunks/{dist-GH_eP8Tg.js → dist-DxDvLdBX.js} +2 -2
- package/dist/chunks/{index-BMzgW9kD.js → index-BJAiOYNA.js} +89 -98
- package/dist/chunks/{index-Cxvsb1M_.js → index-BMvT5fJ_.js} +2 -2
- package/dist/chunks/{index-CwXeUlav.js → index-CF-D_uxJ.js} +1 -1
- package/dist/chunks/{index-aLCprMse.js → index-CxHFTZ5V.js} +1 -1
- package/dist/chunks/{mountEngine-C_tda95f.js → mountEngine-DURf9AtR.js} +8958 -9128
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/network/places/index.d.ts +3 -3
- package/dist/types/types.d.ts +8 -24
- package/dist/types/ui/countries.d.ts +6 -0
- package/dist/types/ui/kycRegions.d.ts +12 -0
- package/dist/types/ui/kycValidation.d.ts +7 -2
- package/dist/types/ui/react/KycFieldGroupCard.d.ts +2 -2
- package/dist/types/ui/react/KycFields.d.ts +1 -5
- package/dist/types/ui/react/checkoutStore.d.ts +6 -7
- package/dist/types/ui/react/useCountryOptions.d.ts +2 -0
- package/dist/types/ui/react/useRegionOptions.d.ts +5 -0
- package/dist/types/ui/regionDirectory.d.ts +14 -0
- package/package.json +1 -1
- package/dist/types/ui/kycPlaceAddress.d.ts +0 -11
- package/dist/types/ui/react/AddressSearch/AddressSearch.d.ts +0 -3
- package/dist/types/ui/react/AddressSearch/AddressSearch.helpers.d.ts +0 -21
- package/dist/types/ui/react/AddressSearch/useAddressSearch.d.ts +0 -21
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Va = Object.defineProperty;
|
|
2
2
|
var Ka = (e, t, r) => t in e ? Va(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Ee = (e, t, r) => Ka(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { E as Ja } from "./index-
|
|
5
|
-
import { g as ri, c as gr } from "./mountEngine-
|
|
4
|
+
import { E as Ja } from "./index-CF-D_uxJ.js";
|
|
5
|
+
import { g as ri, c as gr } from "./mountEngine-DURf9AtR.js";
|
|
6
6
|
var _r = { exports: {} }, on, Hi;
|
|
7
7
|
function Ya() {
|
|
8
8
|
if (Hi) return on;
|
|
@@ -7879,7 +7879,7 @@ var Cn, Rs, Is, Fs, qe, gt, _t, xr, Bs, Os, Cr, zt, Ps, Ns, Ds, ta, ra = V({
|
|
|
7879
7879
|
}
|
|
7880
7880
|
getActiveSession() {
|
|
7881
7881
|
return S(this, null, function* () {
|
|
7882
|
-
const { kvstore: e } = this, { SessionStore: t } = yield import("./index-
|
|
7882
|
+
const { kvstore: e } = this, { SessionStore: t } = yield import("./index-BMvT5fJ_.js").then((n) => n.i), r = yield t.create(e);
|
|
7883
7883
|
try {
|
|
7884
7884
|
const [n] = yield r.list();
|
|
7885
7885
|
return n;
|
|
@@ -8058,7 +8058,7 @@ Xr(na, {
|
|
|
8058
8058
|
});
|
|
8059
8059
|
function Qd() {
|
|
8060
8060
|
return S(this, null, function* () {
|
|
8061
|
-
const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-
|
|
8061
|
+
const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-CxHFTZ5V.js").then((i) => i.i);
|
|
8062
8062
|
return {
|
|
8063
8063
|
generateKeyPair() {
|
|
8064
8064
|
const i = new r();
|
|
@@ -9329,12 +9329,12 @@ Ta = function() {
|
|
|
9329
9329
|
Ui = function() {
|
|
9330
9330
|
return S(this, null, function* () {
|
|
9331
9331
|
const [e, { DappClient: t }, { createKeyManager: r }] = yield Promise.all([
|
|
9332
|
-
import("./index-
|
|
9333
|
-
import("./dist-
|
|
9332
|
+
import("./index-BMvT5fJ_.js").then((h) => h.i),
|
|
9333
|
+
import("./dist-CgyqdZZP.js"),
|
|
9334
9334
|
Promise.resolve().then(() => (eh(), na))
|
|
9335
9335
|
]), n = yield r(), { adapter: i } = this.options.storage, o = yield e.SessionStore.create(i), l = (
|
|
9336
9336
|
// eslint-disable-next-line no-negated-condition
|
|
9337
|
-
typeof window < "u" ? WebSocket : (yield import("./browser-
|
|
9337
|
+
typeof window < "u" ? WebSocket : (yield import("./browser-ByUw6qxL.js").then((h) => h.b)).WebSocket
|
|
9338
9338
|
), c = yield e.WebSocketTransport.create({
|
|
9339
9339
|
url: uh,
|
|
9340
9340
|
kvstore: i,
|
|
@@ -9399,7 +9399,7 @@ Ba = function(e, t, r, n) {
|
|
|
9399
9399
|
/* MWP */
|
|
9400
9400
|
);
|
|
9401
9401
|
})).catch((c) => S(this, null, function* () {
|
|
9402
|
-
const { ProtocolError: d, ErrorCode: h } = yield import("./index-
|
|
9402
|
+
const { ProtocolError: d, ErrorCode: h } = yield import("./index-BMvT5fJ_.js").then((y) => y.i);
|
|
9403
9403
|
if (c instanceof d)
|
|
9404
9404
|
c.code !== h.REQUEST_EXPIRED && (this.status = "disconnected", yield this.options.ui.factory.unload(c), i.reject(c));
|
|
9405
9405
|
else {
|
|
@@ -9456,7 +9456,7 @@ Pa = function(e, t, r) {
|
|
|
9456
9456
|
/* MWP */
|
|
9457
9457
|
);
|
|
9458
9458
|
} catch (i) {
|
|
9459
|
-
const { ProtocolError: o } = yield import("./index-
|
|
9459
|
+
const { ProtocolError: o } = yield import("./index-BMvT5fJ_.js").then((l) => l.i);
|
|
9460
9460
|
throw this.status = "disconnected", yield this.storage.removeTransportType(), i instanceof o || i instanceof Error ? i : new Error(String(i));
|
|
9461
9461
|
} finally {
|
|
9462
9462
|
this.dappClient.off("session_request", n);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
2
|
var S = (e, t, n) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var h = (e, t, n) => S(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { d as s } from "./index-
|
|
5
|
-
import { v as w } from "./connect-multichain-
|
|
6
|
-
import { a as l } from "./mountEngine-
|
|
4
|
+
import { d as s } from "./index-BMvT5fJ_.js";
|
|
5
|
+
import { v as w } from "./connect-multichain-B5TudJIg.js";
|
|
6
|
+
import { a as l } from "./mountEngine-DURf9AtR.js";
|
|
7
7
|
function m(e) {
|
|
8
8
|
var t, n;
|
|
9
9
|
return typeof ((n = (t = e == null ? void 0 : e.prototype) == null ? void 0 : t.constructor) == null ? void 0 : n.name) == "string";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-
|
|
1
|
+
import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-DURf9AtR.js";
|
|
2
2
|
import { r as En, a as In } from "./utils-Ca8X9WUu.js";
|
|
3
|
-
import { E as Cn } from "./index-
|
|
3
|
+
import { E as Cn } from "./index-CF-D_uxJ.js";
|
|
4
4
|
function Sn(t, e) {
|
|
5
5
|
if (!Te(t, { strict: !1 }))
|
|
6
6
|
throw new Xe({ address: t });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const S = ["USD", "TRY", "PHP"];
|
|
2
2
|
function F(e) {
|
|
3
|
-
return typeof e == "string" &&
|
|
3
|
+
return typeof e == "string" && S.includes(e);
|
|
4
4
|
}
|
|
5
5
|
function d(e) {
|
|
6
6
|
return "sessionID" in e && typeof e.sessionID == "string" && e.sessionID.length > 0;
|
|
@@ -14,7 +14,7 @@ class W extends Error {
|
|
|
14
14
|
super(t, { cause: n }), this.name = "GatewayRequestError", this.errorCode = a;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
async function
|
|
17
|
+
async function h(e) {
|
|
18
18
|
const t = await e.clone().json().catch(() => null);
|
|
19
19
|
return new W({
|
|
20
20
|
statusText: e.statusText,
|
|
@@ -41,33 +41,34 @@ class u {
|
|
|
41
41
|
return this.publishableKey && (a["X-Publishable-Key"] = this.publishableKey), a;
|
|
42
42
|
}
|
|
43
43
|
async request(t, a) {
|
|
44
|
-
const n = `${this.baseUri}${t}`,
|
|
44
|
+
const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json", ...a == null ? void 0 : a.headers }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
|
|
45
45
|
if (s.ok)
|
|
46
46
|
return await s.json();
|
|
47
|
-
throw await
|
|
47
|
+
throw await h(s);
|
|
48
48
|
}
|
|
49
49
|
// For endpoints that reply text/plain rather than JSON (e.g. PATCH
|
|
50
50
|
// /customer/otp -> "OTP sent"). Sends the same JSON request headers but does
|
|
51
51
|
// not call response.json(), which would throw on a non-JSON body.
|
|
52
52
|
async requestText(t, a) {
|
|
53
|
-
const n = `${this.baseUri}${t}`,
|
|
53
|
+
const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json" }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
|
|
54
54
|
if (s.ok)
|
|
55
55
|
return await s.text();
|
|
56
|
-
throw await
|
|
56
|
+
throw await h(s);
|
|
57
57
|
}
|
|
58
58
|
async requestWithFormData(t, a) {
|
|
59
|
-
const n = `${this.baseUri}${t}`,
|
|
59
|
+
const n = `${this.baseUri}${t}`, o = this.headers(), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
|
|
60
60
|
if (s.ok)
|
|
61
61
|
return await s.json();
|
|
62
|
-
throw await
|
|
62
|
+
throw await h(s);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const c = "transaction",
|
|
65
|
+
const c = "transaction", x = [
|
|
66
66
|
"firstName",
|
|
67
67
|
"lastName",
|
|
68
68
|
"email",
|
|
69
69
|
"street",
|
|
70
70
|
"city",
|
|
71
|
+
"subdivision",
|
|
71
72
|
"region",
|
|
72
73
|
"postalCode",
|
|
73
74
|
"country",
|
|
@@ -80,7 +81,7 @@ const c = "transaction", B = [
|
|
|
80
81
|
"nationalIDNumber",
|
|
81
82
|
"customerIDNumber"
|
|
82
83
|
];
|
|
83
|
-
class
|
|
84
|
+
class B extends u {
|
|
84
85
|
async getCryptoTransaction(t) {
|
|
85
86
|
return await this.request(`/${c}/${t}`);
|
|
86
87
|
}
|
|
@@ -122,11 +123,11 @@ class x extends u {
|
|
|
122
123
|
}
|
|
123
124
|
async kycVerification(t, a) {
|
|
124
125
|
const n = new FormData();
|
|
125
|
-
return n.append("asset", a.asset), n.append("network", a.network),
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
return n.append("asset", a.asset), n.append("network", a.network), x.forEach((o) => {
|
|
127
|
+
const r = a[o];
|
|
128
|
+
r && n.append(o, r);
|
|
128
129
|
}), n.append("storeKYC", a.storeKYC ? "true" : "false"), a.customerUUID && n.append("customerUUID", a.customerUUID), a.walletAddress && n.append("walletAddress", a.walletAddress), a.documentType && n.append("documentType", a.documentType), a.documentFiles.forEach(
|
|
129
|
-
(
|
|
130
|
+
(o, r) => n.append("documentFiles", o, `${r + 1}-${o.name}`)
|
|
130
131
|
), await this.requestWithFormData(
|
|
131
132
|
`/${c}/${t}/verification`,
|
|
132
133
|
{
|
|
@@ -139,8 +140,8 @@ class x extends u {
|
|
|
139
140
|
function Y(e, t) {
|
|
140
141
|
t.forEach((a) => {
|
|
141
142
|
Object.getOwnPropertyNames(a.prototype).forEach((n) => {
|
|
142
|
-
const
|
|
143
|
-
|
|
143
|
+
const o = Object.getOwnPropertyDescriptor(a.prototype, n);
|
|
144
|
+
o && Object.defineProperty(e.prototype, n, o);
|
|
144
145
|
});
|
|
145
146
|
});
|
|
146
147
|
}
|
|
@@ -163,17 +164,15 @@ class M extends u {
|
|
|
163
164
|
}
|
|
164
165
|
const C = "places", P = { "X-User": "lydian" };
|
|
165
166
|
class G extends u {
|
|
166
|
-
async
|
|
167
|
-
return await this.request(`/${C}/
|
|
168
|
-
method: "POST",
|
|
167
|
+
async getCountries(t) {
|
|
168
|
+
return await this.request(`/${C}/countries`, {
|
|
169
169
|
headers: P,
|
|
170
|
-
|
|
171
|
-
signal: a
|
|
170
|
+
signal: t
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
|
-
async
|
|
173
|
+
async getStates(t, a) {
|
|
175
174
|
return await this.request(
|
|
176
|
-
`/${C}/
|
|
175
|
+
`/${C}/states?country=${encodeURIComponent(t)}`,
|
|
177
176
|
{ headers: P, signal: a }
|
|
178
177
|
);
|
|
179
178
|
}
|
|
@@ -217,7 +216,7 @@ class _ extends u {
|
|
|
217
216
|
}
|
|
218
217
|
class D extends u {
|
|
219
218
|
}
|
|
220
|
-
Y(D, [
|
|
219
|
+
Y(D, [B, M, G, _]);
|
|
221
220
|
const q = D;
|
|
222
221
|
var y = {
|
|
223
222
|
COMPLIANCE_PENDING: -10,
|
|
@@ -239,7 +238,7 @@ var y = {
|
|
|
239
238
|
}, de = {
|
|
240
239
|
PARTIALLY_PAID: 1,
|
|
241
240
|
OVERPAID: 3
|
|
242
|
-
},
|
|
241
|
+
}, j = {
|
|
243
242
|
PENDING: 0,
|
|
244
243
|
CONFIRMED: 1
|
|
245
244
|
}, m = {
|
|
@@ -247,7 +246,7 @@ var y = {
|
|
|
247
246
|
sandbox: "https://api.sandbox.lydian.com",
|
|
248
247
|
prod: "https://api.lydian.com"
|
|
249
248
|
};
|
|
250
|
-
function
|
|
249
|
+
function H(e) {
|
|
251
250
|
return e.gatewayUrl ? new URL(e.gatewayUrl).origin : e.dev ? m.dev : e.sandbox ? m.sandbox : m.prod;
|
|
252
251
|
}
|
|
253
252
|
function A({
|
|
@@ -255,7 +254,7 @@ function A({
|
|
|
255
254
|
unsupportedKeys: t,
|
|
256
255
|
entryPoint: a
|
|
257
256
|
}) {
|
|
258
|
-
const n = t.filter((
|
|
257
|
+
const n = t.filter((o) => e[o] !== void 0);
|
|
259
258
|
return n.length === 0 ? null : `${n.join(" and ")} ${n.length > 1 ? "are" : "is"} not used by ${a}. Passing it has no effect, so this is almost always a mistake.`;
|
|
260
259
|
}
|
|
261
260
|
function N(e) {
|
|
@@ -263,9 +262,9 @@ function N(e) {
|
|
|
263
262
|
return (t = e.flow) != null && t.walletConnect && !e.walletConnectProjectId ? "walletConnectProjectId is required when flow.walletConnect is on" : null;
|
|
264
263
|
}
|
|
265
264
|
function I(e) {
|
|
266
|
-
return e.gatewayUrl === void 0 ||
|
|
265
|
+
return e.gatewayUrl === void 0 || K(e.gatewayUrl) ? null : `gatewayUrl must be an http(s) origin such as http://localhost:8000, with no path, got ${JSON.stringify(e.gatewayUrl)}`;
|
|
267
266
|
}
|
|
268
|
-
function
|
|
267
|
+
function K(e) {
|
|
269
268
|
let t;
|
|
270
269
|
try {
|
|
271
270
|
t = new URL(e);
|
|
@@ -280,7 +279,7 @@ function ue(e) {
|
|
|
280
279
|
function ye(e) {
|
|
281
280
|
return e !== null && !d(e);
|
|
282
281
|
}
|
|
283
|
-
function
|
|
282
|
+
function pe({
|
|
284
283
|
options: e,
|
|
285
284
|
session: t,
|
|
286
285
|
settled: a
|
|
@@ -294,7 +293,7 @@ function L(e, t, a) {
|
|
|
294
293
|
console.error(`onEvent("${t}") threw:`, n);
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
|
-
function
|
|
296
|
+
function p(e) {
|
|
298
297
|
if (!e)
|
|
299
298
|
return;
|
|
300
299
|
let t;
|
|
@@ -311,13 +310,13 @@ async function z({
|
|
|
311
310
|
emit: a
|
|
312
311
|
}) {
|
|
313
312
|
try {
|
|
314
|
-
const n = await Q({ api: e, options: t }), { session:
|
|
315
|
-
a("session.loaded", Z(
|
|
313
|
+
const n = await Q({ api: e, options: t }), { session: o, sessionPromoted: r } = await X({ api: e, sessionID: n });
|
|
314
|
+
a("session.loaded", Z(o));
|
|
316
315
|
const s = await V({
|
|
317
316
|
api: e,
|
|
318
|
-
transactionID:
|
|
317
|
+
transactionID: o.transactionID
|
|
319
318
|
});
|
|
320
|
-
return { ok: !0, session:
|
|
319
|
+
return { ok: !0, session: o, sessionPromoted: r, linkedTransaction: s };
|
|
321
320
|
} catch (n) {
|
|
322
321
|
return { ok: !1, ...await J(n) };
|
|
323
322
|
}
|
|
@@ -337,7 +336,7 @@ async function J(e) {
|
|
|
337
336
|
}
|
|
338
337
|
}
|
|
339
338
|
function T(e) {
|
|
340
|
-
return typeof e == "string" ?
|
|
339
|
+
return typeof e == "string" ? p(e) : void 0;
|
|
341
340
|
}
|
|
342
341
|
async function Q({
|
|
343
342
|
api: e,
|
|
@@ -379,12 +378,12 @@ async function V({
|
|
|
379
378
|
return console.error("Failed to resolve the session transaction:", a), null;
|
|
380
379
|
}
|
|
381
380
|
}
|
|
382
|
-
function
|
|
381
|
+
function E({
|
|
383
382
|
message: e,
|
|
384
383
|
reason: t,
|
|
385
384
|
shouldEndCheckout: a,
|
|
386
385
|
transactionID: n,
|
|
387
|
-
session:
|
|
386
|
+
session: o
|
|
388
387
|
}) {
|
|
389
388
|
return {
|
|
390
389
|
event: { reason: t, shouldEndCheckout: a, message: e },
|
|
@@ -395,7 +394,7 @@ function S({
|
|
|
395
394
|
// Only a failure that ends the checkout carries a redirect. A retryable one
|
|
396
395
|
// leaves the customer mid-flow with something still to do, and a host that
|
|
397
396
|
// navigated on it would eject them on a hiccup.
|
|
398
|
-
redirectURL: a ?
|
|
397
|
+
redirectURL: a ? p(o == null ? void 0 : o.failureURL) : void 0
|
|
399
398
|
}
|
|
400
399
|
};
|
|
401
400
|
}
|
|
@@ -474,34 +473,26 @@ const ee = {
|
|
|
474
473
|
"kyc.lastNameLabel": "Last name",
|
|
475
474
|
"kyc.lastNamePlaceholder": "Enter last name",
|
|
476
475
|
"kyc.emailPlaceholder": "Enter email address",
|
|
477
|
-
"kyc.
|
|
478
|
-
"kyc.
|
|
479
|
-
"kyc.addressSearchManual": "Enter address manually",
|
|
480
|
-
"kyc.addressSearchSearching": "Searching…",
|
|
481
|
-
"kyc.addressSearchSuggestionCount": "Suggestions: {count}",
|
|
482
|
-
"kyc.addressSearchFetching": "Getting address details…",
|
|
483
|
-
"kyc.addressSearchFilled": "Address filled. Check the details below.",
|
|
484
|
-
"kyc.addressSearchFilledWithBlanks": "Address filled. Some details are still needed.",
|
|
485
|
-
"kyc.addressSearchEditsKept": "Address not applied. Your edits were kept.",
|
|
486
|
-
"kyc.addressSearchUnavailable": "Address search isn't available. Enter your address below.",
|
|
487
|
-
"kyc.streetLabel": "Street address",
|
|
488
|
-
"kyc.streetPlaceholder": "Enter street address",
|
|
476
|
+
"kyc.streetLabel": "Address",
|
|
477
|
+
"kyc.streetPlaceholder": "Enter address",
|
|
489
478
|
"kyc.cityLabel": "City",
|
|
490
479
|
"kyc.cityPlaceholder": "Enter city",
|
|
491
|
-
"kyc.
|
|
492
|
-
"kyc.
|
|
493
|
-
"kyc.
|
|
480
|
+
"kyc.subdivisionLabel": "Barangay",
|
|
481
|
+
"kyc.subdivisionPlaceholder": "Enter barangay",
|
|
482
|
+
"kyc.regionLabel": "Province",
|
|
483
|
+
"kyc.regionPlaceholder": "Enter province",
|
|
484
|
+
"kyc.regionSelectPlaceholder": "Select province",
|
|
485
|
+
"kyc.postalCodeLabel": "ZIP or Postal code",
|
|
494
486
|
"kyc.postalCodePlaceholder": "Enter ZIP or postal code",
|
|
495
487
|
"kyc.walletAddressLabel": "Wallet address",
|
|
496
488
|
"kyc.walletAddressPlaceholder": "Enter wallet address",
|
|
497
489
|
"kyc.dateOfBirthLabel": "Date of birth",
|
|
490
|
+
"kyc.dateOfBirthPlaceholder": "Enter your date of birth",
|
|
498
491
|
"kyc.dateAndPlaceOfBirthChoice": "Place and date of birth",
|
|
499
492
|
"kyc.physicalAddressChoice": "Address",
|
|
500
493
|
"kyc.cityOfBirthLabel": "City of birth",
|
|
501
|
-
"kyc.
|
|
502
|
-
"kyc.
|
|
503
|
-
"kyc.nationalIdLabel": "National identity number",
|
|
504
|
-
"kyc.nationalIdPlaceholder": "Enter national ID number",
|
|
494
|
+
"kyc.nationalIdLabel": "ID number",
|
|
495
|
+
"kyc.nationalIdPlaceholder": "Enter 16-digit ID number",
|
|
505
496
|
"kyc.nationalIdChoice": "National ID number",
|
|
506
497
|
"kyc.customerIdLabel": "Customer identification number",
|
|
507
498
|
"kyc.customerIdPlaceholder": "Enter customer ID number",
|
|
@@ -653,17 +644,17 @@ const ee = {
|
|
|
653
644
|
"validation.customerDetailsMissing": "Customer details are missing.",
|
|
654
645
|
"validation.invalidOtp": "Please enter a valid 6-digit code.",
|
|
655
646
|
"terms.notice": 'By continuing, you agree to Lydian <a href="https://lydian.com/privacy" target="_blank" rel="noopener noreferrer">Terms and Conditions</a> and understand your data will be processed according to the <a href="https://lydian.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Notice</a>.'
|
|
656
|
-
},
|
|
647
|
+
}, v = { en: ee }, U = "en";
|
|
657
648
|
let O = U;
|
|
658
|
-
function
|
|
649
|
+
function he() {
|
|
659
650
|
return O;
|
|
660
651
|
}
|
|
661
652
|
function w(e, t) {
|
|
662
653
|
var n;
|
|
663
|
-
const a = ((n =
|
|
654
|
+
const a = ((n = v[O]) == null ? void 0 : n[e]) ?? v[U][e] ?? e;
|
|
664
655
|
return t ? a.replace(
|
|
665
656
|
/\{(\w+)\}/g,
|
|
666
|
-
(
|
|
657
|
+
(o, r) => t[r] != null ? String(t[r]) : `{${r}}`
|
|
667
658
|
) : a;
|
|
668
659
|
}
|
|
669
660
|
function te(e) {
|
|
@@ -673,7 +664,7 @@ function ae({
|
|
|
673
664
|
transaction: e,
|
|
674
665
|
session: t
|
|
675
666
|
}) {
|
|
676
|
-
var
|
|
667
|
+
var o, r, s;
|
|
677
668
|
const a = te(e.status);
|
|
678
669
|
if (a === "active")
|
|
679
670
|
return null;
|
|
@@ -686,11 +677,11 @@ function ae({
|
|
|
686
677
|
// Negative (non-KYC) status — cancelled / fraud / timeout.
|
|
687
678
|
reason: "blocked",
|
|
688
679
|
transactionID: e.transactionID,
|
|
689
|
-
redirectURL:
|
|
680
|
+
redirectURL: p(t == null ? void 0 : t.failureURL)
|
|
690
681
|
}
|
|
691
682
|
};
|
|
692
|
-
const n = (
|
|
693
|
-
(i) => i.status ===
|
|
683
|
+
const n = (o = e.payments) == null ? void 0 : o.find(
|
|
684
|
+
(i) => i.status === j.CONFIRMED
|
|
694
685
|
);
|
|
695
686
|
return {
|
|
696
687
|
outcome: a,
|
|
@@ -701,12 +692,12 @@ function ae({
|
|
|
701
692
|
},
|
|
702
693
|
result: {
|
|
703
694
|
transactionID: e.transactionID,
|
|
704
|
-
amount: (
|
|
695
|
+
amount: (r = e.amounts) == null ? void 0 : r.totalLocal,
|
|
705
696
|
currency: (s = e.amounts) == null ? void 0 : s.currency,
|
|
706
697
|
asset: n == null ? void 0 : n.cryptoAsset,
|
|
707
698
|
network: n == null ? void 0 : n.cryptoNetwork,
|
|
708
699
|
completedAt: n == null ? void 0 : n.completedAt,
|
|
709
|
-
redirectURL:
|
|
700
|
+
redirectURL: p(t == null ? void 0 : t.successURL)
|
|
710
701
|
}
|
|
711
702
|
};
|
|
712
703
|
}
|
|
@@ -731,7 +722,7 @@ function ne() {
|
|
|
731
722
|
}
|
|
732
723
|
};
|
|
733
724
|
}
|
|
734
|
-
class
|
|
725
|
+
class oe extends HTMLElement {
|
|
735
726
|
constructor() {
|
|
736
727
|
super(), this.engine = null, this.engineLoadPromise = null, this.isTornDown = !1, this.shadow = this.attachShadow({ mode: "open" });
|
|
737
728
|
}
|
|
@@ -741,8 +732,8 @@ class re extends HTMLElement {
|
|
|
741
732
|
this.isTornDown = !1;
|
|
742
733
|
}
|
|
743
734
|
async initialize(t) {
|
|
744
|
-
const a =
|
|
745
|
-
!
|
|
735
|
+
const a = re(t), n = se({ api: a, options: t }), o = await this.loadEngine(t, n);
|
|
736
|
+
!o || this.isTornDown || (this.engine = o, await o.initialize(t, { api: a, sessionLoad: n }));
|
|
746
737
|
}
|
|
747
738
|
async loadEngine(t, a) {
|
|
748
739
|
const n = this.getOrLoadEngine();
|
|
@@ -769,7 +760,7 @@ class re extends HTMLElement {
|
|
|
769
760
|
// Not started in the constructor: a page can carry the tag and never check out.
|
|
770
761
|
// Overlapping initialize() calls share one download.
|
|
771
762
|
getOrLoadEngine() {
|
|
772
|
-
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-
|
|
763
|
+
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-DURf9AtR.js").then((t) => t.m).then((t) => {
|
|
773
764
|
const a = t.mountCheckoutEngine({
|
|
774
765
|
host: this,
|
|
775
766
|
shadowRoot: this.shadow
|
|
@@ -802,45 +793,45 @@ class re extends HTMLElement {
|
|
|
802
793
|
const n = await a;
|
|
803
794
|
if (this.isDismissedByHost)
|
|
804
795
|
return;
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
const
|
|
796
|
+
const o = ne();
|
|
797
|
+
o.setOptions(t);
|
|
798
|
+
const r = n.ok && n.linkedTransaction ? ae({
|
|
808
799
|
transaction: n.linkedTransaction,
|
|
809
800
|
session: n.session
|
|
810
801
|
}) : null;
|
|
811
|
-
if ((
|
|
812
|
-
|
|
802
|
+
if ((r == null ? void 0 : r.outcome) === "succeeded") {
|
|
803
|
+
o.emit("payment.succeeded", r.event), o.paymentSucceeded(r.result);
|
|
813
804
|
return;
|
|
814
805
|
}
|
|
815
|
-
if (
|
|
816
|
-
|
|
817
|
-
reason:
|
|
806
|
+
if (r) {
|
|
807
|
+
o.emit("payment.failed", {
|
|
808
|
+
reason: r.failure.reason,
|
|
818
809
|
shouldEndCheckout: !0,
|
|
819
|
-
message:
|
|
820
|
-
}),
|
|
810
|
+
message: r.message
|
|
811
|
+
}), o.paymentFailed(r.message, r.failure);
|
|
821
812
|
return;
|
|
822
813
|
}
|
|
823
814
|
if (!n.ok && n.cancelURL) {
|
|
824
|
-
|
|
815
|
+
o.emit("payment.canceled"), o.paymentCanceled({ redirectURL: n.cancelURL });
|
|
825
816
|
return;
|
|
826
817
|
}
|
|
827
818
|
if (!n.ok && n.failureURL) {
|
|
828
|
-
const g = w("errors.unableToCreateSession"), b =
|
|
819
|
+
const g = w("errors.unableToCreateSession"), b = E({
|
|
829
820
|
message: g,
|
|
830
821
|
reason: "sessionExpired",
|
|
831
822
|
shouldEndCheckout: !0,
|
|
832
823
|
session: { failureURL: n.failureURL }
|
|
833
824
|
});
|
|
834
|
-
|
|
825
|
+
o.emit("payment.failed", b.event), o.paymentFailed(g, b.failure);
|
|
835
826
|
return;
|
|
836
827
|
}
|
|
837
|
-
const s = w("errors.checkoutUnavailable"), i =
|
|
828
|
+
const s = w("errors.checkoutUnavailable"), i = E({
|
|
838
829
|
message: s,
|
|
839
830
|
reason: "error",
|
|
840
831
|
shouldEndCheckout: !0,
|
|
841
832
|
session: n.ok ? n.session : null
|
|
842
833
|
});
|
|
843
|
-
|
|
834
|
+
o.emit("payment.failed", i.event), o.paymentFailed(s, i.failure);
|
|
844
835
|
}
|
|
845
836
|
// Always teardown and unmount together to avoid leaking the React engine.
|
|
846
837
|
// Clear the cached load so a later initialize() creates a fresh engine.
|
|
@@ -848,9 +839,9 @@ class re extends HTMLElement {
|
|
|
848
839
|
t == null || t.teardown(), t == null || t.unmount(), this.engine = null, this.engineLoadPromise = null;
|
|
849
840
|
}
|
|
850
841
|
}
|
|
851
|
-
function
|
|
842
|
+
function re(e) {
|
|
852
843
|
return new q(
|
|
853
|
-
|
|
844
|
+
H(e),
|
|
854
845
|
d(e) ? void 0 : e.publishableKey
|
|
855
846
|
);
|
|
856
847
|
}
|
|
@@ -864,7 +855,7 @@ function se({
|
|
|
864
855
|
emit: (a, n) => L(t.onEvent, a, n)
|
|
865
856
|
});
|
|
866
857
|
}
|
|
867
|
-
customElements.get("lydian-checkout") || customElements.define("lydian-checkout",
|
|
858
|
+
customElements.get("lydian-checkout") || customElements.define("lydian-checkout", oe);
|
|
868
859
|
function f() {
|
|
869
860
|
return document.querySelector("lydian-checkout");
|
|
870
861
|
}
|
|
@@ -878,7 +869,7 @@ async function ie(e) {
|
|
|
878
869
|
if (a)
|
|
879
870
|
throw new Error(a);
|
|
880
871
|
if (!F(e.transaction.currency))
|
|
881
|
-
throw new Error("Invalid value for currency, valid values are: " +
|
|
872
|
+
throw new Error("Invalid value for currency, valid values are: " + S.join(", "));
|
|
882
873
|
const n = A({
|
|
883
874
|
options: e,
|
|
884
875
|
unsupportedKeys: ["sessionID"],
|
|
@@ -914,23 +905,23 @@ export {
|
|
|
914
905
|
W as G,
|
|
915
906
|
de as P,
|
|
916
907
|
y as T,
|
|
917
|
-
|
|
908
|
+
j as a,
|
|
918
909
|
ye as b,
|
|
919
|
-
|
|
910
|
+
S as c,
|
|
920
911
|
X as d,
|
|
921
912
|
Z as e,
|
|
922
913
|
V as f,
|
|
923
|
-
|
|
914
|
+
he as g,
|
|
924
915
|
d as h,
|
|
925
916
|
F as i,
|
|
926
917
|
te as j,
|
|
927
918
|
ae as k,
|
|
928
919
|
R as l,
|
|
929
|
-
|
|
930
|
-
|
|
920
|
+
pe as m,
|
|
921
|
+
E as n,
|
|
931
922
|
ue as o,
|
|
932
923
|
ne as p,
|
|
933
924
|
Q as r,
|
|
934
|
-
|
|
925
|
+
p as s,
|
|
935
926
|
w as t
|
|
936
927
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as Si, g as wi } from "./mountEngine-
|
|
2
|
-
import { r as Ti } from "./index-
|
|
1
|
+
import { d as Si, g as wi } from "./mountEngine-DURf9AtR.js";
|
|
2
|
+
import { r as Ti } from "./index-CF-D_uxJ.js";
|
|
3
3
|
function Pi(r, u) {
|
|
4
4
|
for (var f = 0; f < u.length; f++) {
|
|
5
5
|
const h = u[f];
|