@payfurl/react-plugin 1.4.0 → 1.6.0
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 +142 -0
- package/dist/DefaultThreeDsProvider-BS9pznAi-fDl8jKzq.js +248 -0
- package/dist/{MetricsGlobalThreeDsProvider-B-EQQsEV-BYhakAA4.js → MetricsGlobalThreeDsProvider-C2mH6Z-m-BTiFsRgv.js} +25 -25
- package/dist/PayWayAppleButton-BcXMphiU-BwJKfUAJ.js +184 -0
- package/dist/components/PayfurlDropin.d.ts +8 -3
- package/dist/{cxpay-VbaQA3_P-DlS7yCqQ.js → cxpay-Bdz9DX5E-9-_yu7t4.js} +1 -1
- package/dist/{default-Diji0SXY-ghmIvhgy.js → default-CmqRUII8-B6Im_IPh.js} +1 -1
- package/dist/{ecentric-BlNDCZo_-Bd8Q_3ZG.js → ecentric-CZzDL4aQ-BRg09Y8f.js} +24 -21
- package/dist/{epna-CxmJ_mqR-D4gbP4NT.js → epna-A5WIS8Rv-DhjWr-Wx.js} +1 -1
- package/dist/{flashbanc-BAxvqtBB-DVXrWV0Z.js → flashbanc-BnKR75SO-BStfAWAb.js} +1 -1
- package/dist/forter-DtCvNxaz-D5SEPByD.js +36 -0
- package/dist/{gpayments-B5KWQV4S-QV7caEyB.js → gpayments-C98_oxi_-D02_MfHY.js} +23 -23
- package/dist/index-CqIxTjar.js +12169 -0
- package/dist/index.d.ts +1 -1
- package/dist/metrics_global-c4lRSySk-WxebdZ3j.js +7 -0
- package/dist/{nmi-Ch7qQ6Av-DbPjmA5v.js → nmi-CrPg94-y-Bco-VeX9.js} +1 -1
- package/dist/{nuvei-DRmlfpTL-ByeKEnae.js → nuvei-8V5Z1Bqi-7VHagYOe.js} +31 -32
- package/dist/{payabli-CiBJ1-vC-BthvUlRk.js → payabli-CAvI6xn--Nz5dJc0q.js} +1 -1
- package/dist/payfurl-react.es.js +1 -1
- package/dist/payfurl-react.umd.js +24 -22
- package/dist/payglocal-BcbX7wj--Dd68qYZO.js +114 -0
- package/dist/{payway_rest-CjgIP42z-7zwBGwnD.js → payway_rest-Det6oVYM-BzfFo5sS.js} +1 -1
- package/dist/{skybank-D7uRF17E-BXng_6yf.js → skybank-CldRW65N-BFprFe0k.js} +1 -1
- package/package.json +4 -3
- package/dist/DefaultThreeDsProvider-CzqbXEws-C21Rr7_5.js +0 -219
- package/dist/PayWayAppleButton-C-XfcgNS-rgWe-QJM.js +0 -163
- package/dist/forter-R2alfHeE-C5KHGNgt.js +0 -33
- package/dist/index-CL6hUU-f.js +0 -11224
- package/dist/metrics_global-HMMDzPlb-CXHJ1NHy.js +0 -7
- package/dist/payglocal-uAPlijwL-CvGatUVh.js +0 -109
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var g = (t, i, s) => i in t ? b(t, i, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[i] = s;
|
|
3
|
+
var r = (t, i, s) => g(t, typeof i != "symbol" ? i + "" : i, s);
|
|
4
|
+
import { R as A, B as v, F as I, A as P, h as m, p as C, g as k } from "./index-CqIxTjar.js";
|
|
5
|
+
var h = {
|
|
6
|
+
CHECKOUT: "CHECKOUT",
|
|
7
|
+
CHARGE: "CHARGE"
|
|
8
|
+
}, c = (t) => ({
|
|
9
|
+
[h.CHECKOUT]: {
|
|
10
|
+
url: t + "/payment_method/checkout",
|
|
11
|
+
method: "POST"
|
|
12
|
+
},
|
|
13
|
+
[h.CHARGE]: {
|
|
14
|
+
url: t + "/charge/checkout",
|
|
15
|
+
method: "POST"
|
|
16
|
+
}
|
|
17
|
+
}), B = class {
|
|
18
|
+
constructor(t, i, s, a, o, e) {
|
|
19
|
+
r(this, "log");
|
|
20
|
+
r(this, "container");
|
|
21
|
+
r(this, "button", null);
|
|
22
|
+
r(this, "validator", null);
|
|
23
|
+
r(this, "validationError", null);
|
|
24
|
+
r(this, "providerId");
|
|
25
|
+
r(this, "apiUrl");
|
|
26
|
+
r(this, "amount");
|
|
27
|
+
r(this, "currency");
|
|
28
|
+
r(this, "clientParameters");
|
|
29
|
+
r(this, "billingAddress", null);
|
|
30
|
+
r(this, "customer", null);
|
|
31
|
+
r(this, "order", null);
|
|
32
|
+
r(this, "buttonId", "apple-pay-payway-button");
|
|
33
|
+
r(this, "validatorId", "apple-pay-payway-button-validator");
|
|
34
|
+
r(this, "onLoad", () => {
|
|
35
|
+
});
|
|
36
|
+
r(this, "onSuccess");
|
|
37
|
+
r(this, "onFailure");
|
|
38
|
+
r(this, "userOnValidate");
|
|
39
|
+
r(this, "httpInvoker", null);
|
|
40
|
+
this.log = t, this.apiUrl = e.apiUrl, this.container = i || document.body, this.clientParameters = e.clientParameters, this.providerId = e.providerId, this.amount = Number(a), this.currency = o, this.providerId = s, this.onSuccess = e.onSuccess || null, this.onFailure = e.onFailure || null, this.userOnValidate = e.onValidate;
|
|
41
|
+
let n = new A(e.environment, v(e.publicKey));
|
|
42
|
+
this.httpInvoker = new I(e.publicKey, e.version, n), this.init(), setInterval(() => {
|
|
43
|
+
var u;
|
|
44
|
+
this.validator && (((u = this.userOnValidate) == null ? void 0 : u.call(this)) === !1 ? this.validator.style.display = "block" : (this.validator.style.display = "none", this.validationError && (this.validationError.style.display = "none")));
|
|
45
|
+
}, 1e3);
|
|
46
|
+
}
|
|
47
|
+
draw() {
|
|
48
|
+
let t = () => {
|
|
49
|
+
this.onLoad = () => {
|
|
50
|
+
};
|
|
51
|
+
let i = {
|
|
52
|
+
container: this.buttonId,
|
|
53
|
+
publishableApiKey: this.clientParameters.PublishableApiKey,
|
|
54
|
+
principalAmount: this.amount,
|
|
55
|
+
currency: String(this.currency).toLowerCase(),
|
|
56
|
+
buttonMode: "callback"
|
|
57
|
+
};
|
|
58
|
+
this.log("[createPaymentRequestButton]", i), window.payway.createPaymentRequestButton(i, (s, a) => {
|
|
59
|
+
var e;
|
|
60
|
+
this.log("[createPaymentRequestButton]", s, a);
|
|
61
|
+
let o = C();
|
|
62
|
+
s ? (k(this.httpInvoker, this.apiUrl, o, this.providerId, "error", {
|
|
63
|
+
detail: typeof (s == null ? void 0 : s.error) == "string" ? s.error : void 0,
|
|
64
|
+
type: "APPLEPAY"
|
|
65
|
+
}), (e = this.onFailure) == null || e.call(this, s)) : this.checkout(a.singleUseTokenId, o);
|
|
66
|
+
}), this.addValidator();
|
|
67
|
+
};
|
|
68
|
+
window.payway ? t() : this.onLoad = t;
|
|
69
|
+
}
|
|
70
|
+
show() {
|
|
71
|
+
this.button && (this.button.style.display = "block");
|
|
72
|
+
}
|
|
73
|
+
hide() {
|
|
74
|
+
this.button && (this.button.style.display = "none");
|
|
75
|
+
}
|
|
76
|
+
init() {
|
|
77
|
+
let t = document.createElement("div");
|
|
78
|
+
t.id = this.buttonId, t.style.position = "relative", this.container.appendChild(t), this.button = t, this.initScript();
|
|
79
|
+
}
|
|
80
|
+
addValidator() {
|
|
81
|
+
var i;
|
|
82
|
+
if (document.getElementById(this.validatorId)) return;
|
|
83
|
+
let t = document.createElement("div");
|
|
84
|
+
t.id = this.validatorId, t.style.width = "100%", t.style.height = "100%", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.display = "none", (i = this.button) == null || i.appendChild(t), this.validator = t;
|
|
85
|
+
}
|
|
86
|
+
initScript() {
|
|
87
|
+
let t = document.createElement("script");
|
|
88
|
+
t.src = "https://api.payway.com.au/rest/v1/payway.js", t.onerror = () => P("[shopper][applePay]", "PayWay script failed to load", []), t.onload = () => {
|
|
89
|
+
this.onLoad && this.onLoad();
|
|
90
|
+
}, document.head.appendChild(t);
|
|
91
|
+
}
|
|
92
|
+
checkout(t, i) {
|
|
93
|
+
var a, o, e, n, u, p;
|
|
94
|
+
let s = {
|
|
95
|
+
providerId: this.providerId,
|
|
96
|
+
amount: this.amount,
|
|
97
|
+
currency: this.currency,
|
|
98
|
+
reference: (a = this.order) == null ? void 0 : a.orderNumber,
|
|
99
|
+
options: { ProviderToken: t },
|
|
100
|
+
customer: {
|
|
101
|
+
firstName: (o = this.customer) == null ? void 0 : o.firstName,
|
|
102
|
+
lastName: (e = this.customer) == null ? void 0 : e.lastName,
|
|
103
|
+
email: (n = this.customer) == null ? void 0 : n.email,
|
|
104
|
+
phone: (u = this.customer) == null ? void 0 : u.phoneNumber,
|
|
105
|
+
billingAddress: this.billingAddress && {
|
|
106
|
+
name: `${this.billingAddress.firstName} ${this.billingAddress.lastName}`,
|
|
107
|
+
addressLine1: this.billingAddress.streetAddress,
|
|
108
|
+
addressLine2: this.billingAddress.streetAddress2,
|
|
109
|
+
suburb: this.billingAddress.city,
|
|
110
|
+
countryCode: this.billingAddress.country,
|
|
111
|
+
postcode: this.billingAddress.postalCode,
|
|
112
|
+
state: this.billingAddress.state
|
|
113
|
+
} || void 0
|
|
114
|
+
},
|
|
115
|
+
items: this.order && this.order.orderItems.map((l) => ({
|
|
116
|
+
name: l.name,
|
|
117
|
+
reference: l.sku,
|
|
118
|
+
quantity: Number(l.quantity),
|
|
119
|
+
amount: Number(l.unitPrice)
|
|
120
|
+
})) || []
|
|
121
|
+
};
|
|
122
|
+
this.log("[PayWayAppleButton][checkout]", s), (p = this.httpInvoker) == null || p.invoke(c(this.apiUrl)[h.CHECKOUT].url, c(this.apiUrl)[h.CHECKOUT].method, JSON.stringify(s), (l, d) => {
|
|
123
|
+
this.log("[PayWayAppleButton][checkout]: successCheckoutHandler", l, d);
|
|
124
|
+
let y;
|
|
125
|
+
try {
|
|
126
|
+
y = JSON.parse(window.atob(JSON.parse(d).checkoutData)).checkoutId;
|
|
127
|
+
} catch {
|
|
128
|
+
this.fail(d);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.charge(y, i);
|
|
132
|
+
}, (l, d) => {
|
|
133
|
+
this.log("[PayWayAppleButton][checkout]: failureCheckoutHandler", l, d), this.fail(d);
|
|
134
|
+
}, m(i));
|
|
135
|
+
}
|
|
136
|
+
charge(t, i) {
|
|
137
|
+
var s;
|
|
138
|
+
this.log("[PayWayAppleButton][charge]", { checkoutId: t }), (s = this.httpInvoker) == null || s.invoke(c(this.apiUrl)[h.CHARGE].url, c(this.apiUrl)[h.CHARGE].method, JSON.stringify({ checkoutId: t }), (a, o) => {
|
|
139
|
+
var n;
|
|
140
|
+
this.log("[PayWayAppleButton][charge]: successChargeHandler", a, o);
|
|
141
|
+
let e = null;
|
|
142
|
+
try {
|
|
143
|
+
e = JSON.parse(o);
|
|
144
|
+
} catch {
|
|
145
|
+
}
|
|
146
|
+
(n = this.onSuccess) == null || n.call(this, {
|
|
147
|
+
transactionId: e == null ? void 0 : e.chargeId,
|
|
148
|
+
status: e == null ? void 0 : e.status
|
|
149
|
+
});
|
|
150
|
+
}, (a, o) => {
|
|
151
|
+
this.log("[PayWayAppleButton][charge]: failureChargeHandler", a, o), this.fail(o);
|
|
152
|
+
}, m(i));
|
|
153
|
+
}
|
|
154
|
+
fail(t) {
|
|
155
|
+
var s, a;
|
|
156
|
+
let i;
|
|
157
|
+
try {
|
|
158
|
+
i = (s = JSON.parse(t)) == null ? void 0 : s.message;
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
(a = this.onFailure) == null || a.call(this, { error: i || "Unable to pay with ApplePay" });
|
|
162
|
+
}
|
|
163
|
+
redraw() {
|
|
164
|
+
this.button && (this.button.innerHTML = "", this.draw());
|
|
165
|
+
}
|
|
166
|
+
setAmount(t) {
|
|
167
|
+
this.log("[PayWayAppleButton][setAmount]", t), this.amount = t, this.redraw();
|
|
168
|
+
}
|
|
169
|
+
setCurrency(t) {
|
|
170
|
+
this.log("[PayWayAppleButton][setCurrency]", t), this.currency = t, this.redraw();
|
|
171
|
+
}
|
|
172
|
+
setCustomerInfo(t) {
|
|
173
|
+
this.log("[PayWayAppleButton][setCustomerInfo]", t), this.customer = { ...t };
|
|
174
|
+
}
|
|
175
|
+
setBillingAddress(t) {
|
|
176
|
+
this.log("[PayWayAppleButton][setBillingAddress]", t), this.billingAddress = { ...t };
|
|
177
|
+
}
|
|
178
|
+
setOrderInfo(t) {
|
|
179
|
+
this.log("[PayWayAppleButton][setOrderInfo]", t), this.order = { ...t };
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
B as PayWayAppleButton
|
|
184
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DropInOptionsType, EnvironmentName, FailureResponseType, SuccessResponseType } from "@payfurl/client";
|
|
1
|
+
import type { AddressInfoType, CustomerInfoType, DropInOptionsType, EnvironmentName, FailureResponseType, OrderInfoType, PaymentMethodStatusType, SuccessResponseType, ThreeDsProgressType } from "@payfurl/client";
|
|
2
2
|
interface PayfurlDropinProps {
|
|
3
3
|
environment: EnvironmentName;
|
|
4
4
|
publicKey: string;
|
|
@@ -7,11 +7,16 @@ interface PayfurlDropinProps {
|
|
|
7
7
|
currency: string;
|
|
8
8
|
successMessage?: string;
|
|
9
9
|
options?: DropInOptionsType;
|
|
10
|
+
customer?: CustomerInfoType;
|
|
11
|
+
billingAddress?: AddressInfoType;
|
|
12
|
+
order?: OrderInfoType;
|
|
10
13
|
onSuccess: (message: SuccessResponseType) => void;
|
|
11
14
|
onFailure: (message: FailureResponseType) => void;
|
|
12
|
-
onLoaded
|
|
13
|
-
onValidationStatusChange
|
|
15
|
+
onLoaded?: () => void;
|
|
16
|
+
onValidationStatusChange?: (status: string, message: string) => void;
|
|
14
17
|
onValidate?: () => boolean;
|
|
18
|
+
onPaymentMethodStatus?: (status: PaymentMethodStatusType) => void;
|
|
19
|
+
onThreeDsProgress?: (progress: ThreeDsProgressType) => void;
|
|
15
20
|
}
|
|
16
21
|
declare const PayfurlDropin: (props: PayfurlDropinProps) => import("react").JSX.Element;
|
|
17
22
|
export default PayfurlDropin;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var d = (
|
|
3
|
-
var h = (
|
|
4
|
-
import { O as m } from "./DefaultThreeDsProvider-
|
|
5
|
-
import {
|
|
6
|
-
var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" },
|
|
2
|
+
var d = (a, e, t) => e in a ? u(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var h = (a, e, t) => d(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { O as m } from "./DefaultThreeDsProvider-BS9pznAi-fDl8jKzq.js";
|
|
5
|
+
import { q as D, u as p, e as g, a as S, t as v, X as l, Z as y, S as f, r as T, z as C, b as I, c as P, l as b } from "./index-CqIxTjar.js";
|
|
6
|
+
var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" }, R = ["action"], _ = ["value"], $ = /* @__PURE__ */ p(/* @__PURE__ */ g({
|
|
7
7
|
__name: "ecentric",
|
|
8
8
|
props: {
|
|
9
9
|
threeDSServerTransID: {},
|
|
@@ -12,13 +12,13 @@ var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" },
|
|
|
12
12
|
authenticationValue: {}
|
|
13
13
|
},
|
|
14
14
|
emits: ["close", "submit"],
|
|
15
|
-
setup(
|
|
16
|
-
let
|
|
15
|
+
setup(a, { emit: e }) {
|
|
16
|
+
let t = a, i = e, r = C(() => b(t.formAction) ? t.formAction : ""), o = I(null), c = t.authenticationValue;
|
|
17
17
|
return S(() => {
|
|
18
|
-
var
|
|
19
|
-
r.value && ((
|
|
20
|
-
}), (
|
|
21
|
-
y(f, { onClick: s[0] || (s[0] = (
|
|
18
|
+
var n;
|
|
19
|
+
r.value && ((n = o.value) == null || n.submit());
|
|
20
|
+
}), (n, s) => (P(), v("div", A, [l("div", V, [l("div", F, [
|
|
21
|
+
y(f, { onClick: s[0] || (s[0] = (E) => i("close")) }),
|
|
22
22
|
s[1] || (s[1] = l("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)),
|
|
23
23
|
l("form", {
|
|
24
24
|
action: r.value,
|
|
@@ -30,10 +30,10 @@ var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" },
|
|
|
30
30
|
type: "hidden",
|
|
31
31
|
name: "PaReq",
|
|
32
32
|
value: T(c)
|
|
33
|
-
}, null, 8,
|
|
33
|
+
}, null, 8, _)], 8, R)
|
|
34
34
|
])])]));
|
|
35
35
|
}
|
|
36
|
-
}), [["__scopeId", "data-v-bdfafa40"]]),
|
|
36
|
+
}), [["__scopeId", "data-v-bdfafa40"]]), x = class extends m {
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments);
|
|
39
39
|
h(this, "paResPayload", "");
|
|
@@ -51,21 +51,24 @@ var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" },
|
|
|
51
51
|
authenticationValue: this.paResPayload
|
|
52
52
|
}, this.onSuccess, this.onError);
|
|
53
53
|
}
|
|
54
|
-
doChallenge(e,
|
|
54
|
+
doChallenge(e, t, i) {
|
|
55
55
|
this.log(`[${this.getType()}][doChallenge]`), this.setChallengeFrameVisible(!0);
|
|
56
56
|
let { destroy: r } = D({
|
|
57
57
|
el: document.body,
|
|
58
|
-
component:
|
|
58
|
+
component: $,
|
|
59
59
|
props: {
|
|
60
60
|
threeDSServerTransID: this.threeDSServerTransID,
|
|
61
|
-
acsTransID:
|
|
61
|
+
acsTransID: t,
|
|
62
62
|
formAction: e,
|
|
63
|
-
authenticationValue:
|
|
63
|
+
authenticationValue: i
|
|
64
64
|
},
|
|
65
65
|
on: { close: () => {
|
|
66
66
|
var o;
|
|
67
67
|
r(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {
|
|
68
|
-
}, (o = this.threeDsProcessor) == null || o.onError({
|
|
68
|
+
}, (o = this.threeDsProcessor) == null || o.onError({
|
|
69
|
+
error: "Challenge cancelled",
|
|
70
|
+
cancelReason: "abandoned"
|
|
71
|
+
});
|
|
69
72
|
} }
|
|
70
73
|
});
|
|
71
74
|
this.threeDSDestroy = r;
|
|
@@ -74,9 +77,9 @@ var A = { class: "mask" }, V = { class: "wrapper" }, F = { class: "container" },
|
|
|
74
77
|
this.log(`[${this.getType()}]: 3Ds Challenge complete`, e.data), this.closeChallenge(), this.log(`[${this.getType()}]: cresData`, e.data.cres), e.data.cres ? (this.paResPayload = e.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}]: Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge"));
|
|
75
78
|
}
|
|
76
79
|
};
|
|
77
|
-
function
|
|
78
|
-
return new
|
|
80
|
+
function z(a, e, t) {
|
|
81
|
+
return new x(a, e, t);
|
|
79
82
|
}
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
z as default
|
|
82
85
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var u = (t, e, s) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var h = (t, e, s) => u(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { O as g } from "./DefaultThreeDsProvider-BS9pznAi-fDl8jKzq.js";
|
|
5
|
+
import { e as m, a as p, s as f } from "./managedOrders-ojoMZ0Ab-B94-Nsp-.js";
|
|
6
|
+
import { d as S, v as D } from "./index-CqIxTjar.js";
|
|
7
|
+
var { hideSpinner: O } = D(), T = class extends g {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
h(this, "onDoAuthSuccess", (e, s) => {
|
|
11
|
+
var n;
|
|
12
|
+
let o = JSON.parse(s);
|
|
13
|
+
this.log(`[${this.getType()}][onDoAuthSuccess]`, o);
|
|
14
|
+
let i = ((n = this.options.clientParameters) == null ? void 0 : n.SiteId) || "", a = o.managedOrderToken;
|
|
15
|
+
!a || !m.test(i) ? this.onError(e, "3DS could not be started") : p(i).then(() => {
|
|
16
|
+
let r = !1, d = S(this.container, () => {
|
|
17
|
+
r = !0, this.setChallengeFrameVisible(!0), O();
|
|
18
|
+
});
|
|
19
|
+
f(a, this.container, (l) => {
|
|
20
|
+
d(), r && this.setChallengeFrameVisible(!1), l ? (this.log(`[${this.getType()}]: manageOrder failed`, l), this.onError(400, "3DS failed")) : this.onPostAuth();
|
|
21
|
+
});
|
|
22
|
+
}, (r) => {
|
|
23
|
+
this.log(`[${this.getType()}]: managedOrders.js failed to load`, r), this.onError(400, "3DS could not be started");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
getType() {
|
|
28
|
+
return "Forter";
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
function A(t, e, s) {
|
|
32
|
+
return new T(t, e, s);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
A as default
|
|
36
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var l = Object.defineProperty;
|
|
2
2
|
var o = (r, e, t) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var h = (r, e, t) => o(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { O as u } from "./DefaultThreeDsProvider-
|
|
5
|
-
import {
|
|
6
|
-
var y = { class: "mask" }, f = { class: "wrapper" },
|
|
4
|
+
import { O as u } from "./DefaultThreeDsProvider-BS9pznAi-fDl8jKzq.js";
|
|
5
|
+
import { q as c, l as n, v as d, u as p, e as g, t as S, X as a, f as i, z as D, c as m } from "./index-CqIxTjar.js";
|
|
6
|
+
var y = { class: "mask" }, f = { class: "wrapper" }, v = ["src"], C = /* @__PURE__ */ p(/* @__PURE__ */ g({
|
|
7
7
|
__name: "GPayments",
|
|
8
8
|
props: {
|
|
9
9
|
url: {},
|
|
@@ -18,45 +18,41 @@ var y = { class: "mask" }, f = { class: "wrapper" }, A = ["src"], C = /* @__PURE
|
|
|
18
18
|
height: `${e.height || 400}px`
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
return (U, R) => (m(), S("div", y, [
|
|
21
|
+
return (U, R) => (m(), S("div", y, [a("div", f, [a("div", {
|
|
22
22
|
class: "container",
|
|
23
|
-
style:
|
|
23
|
+
style: i([s(), {
|
|
24
24
|
padding: "0",
|
|
25
25
|
margin: "0"
|
|
26
26
|
}])
|
|
27
|
-
}, [
|
|
27
|
+
}, [a("iframe", {
|
|
28
28
|
src: t.value,
|
|
29
|
-
style:
|
|
30
|
-
}, null, 12,
|
|
29
|
+
style: i(s())
|
|
30
|
+
}, null, 12, v)], 4)])]));
|
|
31
31
|
}
|
|
32
|
-
}), [["__scopeId", "data-v-cf5aa816"]]), { hideSpinner:
|
|
32
|
+
}), [["__scopeId", "data-v-cf5aa816"]]), { hideSpinner: A } = d(), T = class extends u {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
35
35
|
h(this, "onDoAuthSuccess", (e, t) => {
|
|
36
36
|
let s = JSON.parse(t);
|
|
37
37
|
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, s), !s.transStatus) this.onError(e, "No transStatus specified");
|
|
38
|
-
else
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
break;
|
|
46
|
-
default:
|
|
47
|
-
this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${s.transStatus}`), this.onPostAuth();
|
|
48
|
-
}
|
|
38
|
+
else if (s.transStatus === "C") {
|
|
39
|
+
if (!s.acsURL) {
|
|
40
|
+
this.onError(e, "Invalid Challenge Url");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.doChallenge(s.acsURL);
|
|
44
|
+
} else this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ${s.transStatus}`), this.onPostAuth();
|
|
49
45
|
});
|
|
50
46
|
h(this, "onInitAuthSuccess", (e, t) => {
|
|
51
47
|
let s = JSON.parse(t);
|
|
52
|
-
this.log(`[${this.getType()}][onInitAuthSuccess]`, s), s.threeDSAuthURL ? (this.threeDSRequestorTransID = s.threeDSRequestorTransID, this.threeDSServerTransID = s.threeDSServerTransID, this.threeDSMonitorURL = s.threeDSMonitorURL, this.threeDSAuthURL = s.threeDSAuthURL, s.threeDsServerCallbackUrl ? this.initFrame(s.threeDsServerCallbackUrl) : this.onAuth(!1, "")) : this.onError(e, "No AuthUrl specified");
|
|
48
|
+
this.log(`[${this.getType()}][onInitAuthSuccess]`, s), s.threeDSAuthURL ? (this.threeDSRequestorTransID = s.threeDSRequestorTransID, this.threeDSServerTransID = s.threeDSServerTransID, this.threeDSMonitorURL = s.threeDSMonitorURL, this.threeDSAuthURL = s.threeDSAuthURL, s.threeDsServerCallbackUrl ? (this.initFrame(s.threeDsServerCallbackUrl), this.awaitMethod()) : this.onAuth(!1, "")) : this.onError(e, "No AuthUrl specified");
|
|
53
49
|
});
|
|
54
50
|
}
|
|
55
51
|
getType() {
|
|
56
52
|
return "GPayments";
|
|
57
53
|
}
|
|
58
54
|
doChallenge(e) {
|
|
59
|
-
this.log(`[${this.getType()}][doChallenge]`),
|
|
55
|
+
this.log(`[${this.getType()}][doChallenge]`), A(), this.setChallengeFrameVisible(!0);
|
|
60
56
|
let { destroy: t } = c({
|
|
61
57
|
el: document.body,
|
|
62
58
|
component: C,
|
|
@@ -66,8 +62,12 @@ var y = { class: "mask" }, f = { class: "wrapper" }, A = ["src"], C = /* @__PURE
|
|
|
66
62
|
height: 400
|
|
67
63
|
},
|
|
68
64
|
on: { close: () => {
|
|
65
|
+
var s;
|
|
69
66
|
t(), this.threeDSDestroy = () => {
|
|
70
|
-
}
|
|
67
|
+
}, (s = this.threeDsProcessor) == null || s.onError({
|
|
68
|
+
error: "Challenge cancelled",
|
|
69
|
+
cancelReason: "abandoned"
|
|
70
|
+
});
|
|
71
71
|
} }
|
|
72
72
|
});
|
|
73
73
|
this.threeDSDestroy = t;
|