@payfurl/client 4.8.6 → 4.9.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/dist/sdk/ApplePayButton.interface-BvRk9kiK.js +0 -0
- package/dist/sdk/ApplePayButtonOptions.type-BvRk9kiK.js +0 -0
- package/dist/sdk/CloseIcon-BJgZxU_4.js +3374 -0
- package/dist/sdk/CxPayThreeDsProvider-lD7RyyaH.js +12 -0
- package/dist/sdk/DefaultThreeDsProvider-aIZr-d29.js +222 -0
- package/dist/sdk/EcentricThreeDsProvider-B7Hq90Yp.js +68 -0
- package/dist/sdk/EpnaThreeDsProvider-BAO2GROY.js +12 -0
- package/dist/sdk/FlashBancThreeDsProvider-CIZpoTAj.js +12 -0
- package/dist/sdk/GPaymentsThreeDsProvider-COuZ_3w6.js +89 -0
- package/dist/sdk/MetricsGlobalThreeDsProvider-D3x5hiTk.js +133 -0
- package/dist/sdk/NmiThreeDsProvider-fLTB46dM.js +12 -0
- package/dist/sdk/NuveiThreeDsProvider-BpWi_OJA.js +149 -0
- package/dist/sdk/PayGLocalThreeDsProvider-DvA8Ng4u.js +113 -0
- package/dist/sdk/PayWayAppleButton-DESHrVB-.js +160 -0
- package/dist/sdk/PayabliThreeDsProvider-B34Ah8DW.js +12 -0
- package/dist/sdk/SkyBankThreeDsProvider-0S5UKz-C.js +12 -0
- package/dist/sdk/ThreeDsAuthResponse.type-BvRk9kiK.js +0 -0
- package/dist/sdk/ThreeDsInitResponse.type-BvRk9kiK.js +0 -0
- package/dist/sdk/ThreeDsPostAuthResponse.type-BFN9wqum.js +26 -0
- package/dist/sdk/ThreeDsProvider.interface-BvRk9kiK.js +0 -0
- package/dist/sdk/alerts-Bad_5Z62.js +42 -0
- package/dist/sdk/cxpay-2tlxyzUF.js +7 -0
- package/dist/sdk/default-Sih0fC9J.js +7 -0
- package/dist/sdk/ecentric-CN_DxZw6.js +7 -0
- package/dist/sdk/epna-CuWMBne4.js +7 -0
- package/dist/sdk/favicon.ico +0 -0
- package/dist/sdk/flashbanc-YdmE24o7.js +7 -0
- package/dist/sdk/forter-CcQiwntl.js +60 -0
- package/dist/sdk/forterDeviceIntelScript-DdHZ7KLR.js +4 -0
- package/dist/sdk/fraudCheck.type-BvRk9kiK.js +0 -0
- package/dist/sdk/fraudProvider.type-Bzd9orn2.js +7 -0
- package/dist/sdk/fraudStatus.type-BvRk9kiK.js +0 -0
- package/dist/sdk/gpayments-DVhgcMCp.js +7 -0
- package/dist/sdk/metrics_global-DshQOuaW.js +7 -0
- package/dist/sdk/nmi-Qo4scfgJ.js +7 -0
- package/dist/sdk/nuvei-BFllJ45f.js +7 -0
- package/dist/sdk/payabli-eGPashQz.js +7 -0
- package/dist/sdk/payfurl.es.js +7047 -3
- package/dist/sdk/payfurl.umd.js +17 -29
- package/dist/sdk/payglocal-WvM5v5cn.js +7 -0
- package/dist/sdk/payway_rest-m9k6k7M0.js +7 -0
- package/dist/sdk/screen-D7xBu0cj.js +24 -0
- package/dist/sdk/skybank-174OmYCW.js +7 -0
- package/dist/sdk/strings-C1wc79_e.js +119 -0
- package/dist/sdk/style.css +2 -1
- package/package.json +3 -3
- package/dist/sdk/CxPayThreeDsProvider-Bz7O7f0F.js +0 -12
- package/dist/sdk/DefaultThreeDsProvider-VHq5xoNU.js +0 -243
- package/dist/sdk/EcentricThreeDsProvider-CWRQYa9Y.js +0 -89
- package/dist/sdk/EpnaThreeDsProvider-C_tojNLc.js +0 -12
- package/dist/sdk/FlashBancThreeDsProvider-DvD_hlHn.js +0 -12
- package/dist/sdk/GPaymentsThreeDsProvider-DSa9kCKg.js +0 -105
- package/dist/sdk/MetricsGlobalThreeDsProvider-C1KPszqD.js +0 -152
- package/dist/sdk/NmiThreeDsProvider-CK1dan0G.js +0 -12
- package/dist/sdk/NuveiThreeDsProvider-Cu2fB7rt.js +0 -181
- package/dist/sdk/PayGLocalThreeDsProvider-Dsi0JOu8.js +0 -127
- package/dist/sdk/PayWayAppleButton-DNeVogl8.js +0 -179
- package/dist/sdk/PayabliThreeDsProvider-COchAXx2.js +0 -12
- package/dist/sdk/SkyBankThreeDsProvider-BETsDyuS.js +0 -12
- package/dist/sdk/ThreeDsPostAuthResponse.type-CaV_50Qh.js +0 -26
- package/dist/sdk/cxpay-CWoG5bR0.js +0 -7
- package/dist/sdk/default-CKovzYoW.js +0 -7
- package/dist/sdk/ecentric-RPlS3J2Q.js +0 -7
- package/dist/sdk/epna-DIkbQdLV.js +0 -7
- package/dist/sdk/flashbanc-DrIG4m7r.js +0 -7
- package/dist/sdk/forter-CfW26Mkn.js +0 -46
- package/dist/sdk/fraudProvider.type-ewIWghbD.js +0 -7
- package/dist/sdk/fraudStatus.type-u9AIbDtQ.js +0 -13704
- package/dist/sdk/gpayments-DbPzgcxs.js +0 -7
- package/dist/sdk/metrics_global-CEnYLnX-.js +0 -7
- package/dist/sdk/nmi-DcUbphxD.js +0 -7
- package/dist/sdk/nuvei-HtM7MLjQ.js +0 -7
- package/dist/sdk/payabli-BgNx9N_g.js +0 -7
- package/dist/sdk/payglocal-DvdtjOZ3.js +0 -7
- package/dist/sdk/payway_rest-eM0Wk9-Y.js +0 -7
- package/dist/sdk/skybank-BFv-efpg.js +0 -7
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Et as e, Ot as t, Tt as n, Z as r, dt as i, h as a, n as o, vt as s, xt as c } from "./CloseIcon-BJgZxU_4.js";
|
|
2
|
+
import { t as l } from "./alerts-Bad_5Z62.js";
|
|
3
|
+
import { t as u } from "./DefaultThreeDsProvider-aIZr-d29.js";
|
|
4
|
+
//#region src/sdk/3ds/nuvei.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var d = { class: "mask" }, f = /*#__PURE__*/ r(/* @__PURE__ */ n({
|
|
6
|
+
__name: "nuvei",
|
|
7
|
+
props: {
|
|
8
|
+
threeDSServerTransID: {},
|
|
9
|
+
sessionToken: {},
|
|
10
|
+
env: {},
|
|
11
|
+
merchantId: {},
|
|
12
|
+
merchantSiteId: {},
|
|
13
|
+
cardNumber: {},
|
|
14
|
+
cardHolderName: {},
|
|
15
|
+
expirationMonth: {},
|
|
16
|
+
expirationYear: {},
|
|
17
|
+
CVV: {},
|
|
18
|
+
firstName: {},
|
|
19
|
+
lastName: {},
|
|
20
|
+
email: {},
|
|
21
|
+
country: {}
|
|
22
|
+
},
|
|
23
|
+
setup(n) {
|
|
24
|
+
let { hideSpinner: r, showSpinner: i } = o(), a = n;
|
|
25
|
+
e(() => {
|
|
26
|
+
i();
|
|
27
|
+
let e = document.createElement("script");
|
|
28
|
+
e.type = "text/javascript", e.src = "https://cdn.safecharge.com/safecharge_resources/v1/websdk/safecharge.js", e.onload = () => {
|
|
29
|
+
let e = new MutationObserver(function() {
|
|
30
|
+
document.getElementsByClassName("sfcModal-dialog")[0] && (r(), e.disconnect());
|
|
31
|
+
}), t = { childList: !0 }, n = document.querySelector("body");
|
|
32
|
+
e.observe(n, t), l();
|
|
33
|
+
}, document.head.appendChild(e);
|
|
34
|
+
});
|
|
35
|
+
function l() {
|
|
36
|
+
var e = SafeCharge({
|
|
37
|
+
env: a.env,
|
|
38
|
+
merchantId: a.merchantId,
|
|
39
|
+
merchantSiteId: a.merchantSiteId
|
|
40
|
+
});
|
|
41
|
+
e.fields({
|
|
42
|
+
fonts: [{ cssUrl: "https://fonts.googleapis.com/css?family=Source+Code+Pro" }],
|
|
43
|
+
locale: "en"
|
|
44
|
+
}), e.authenticate3d({
|
|
45
|
+
sessionToken: a.sessionToken,
|
|
46
|
+
paymentOption: { card: {
|
|
47
|
+
cardNumber: a.cardNumber,
|
|
48
|
+
cardHolderName: a.cardHolderName,
|
|
49
|
+
expirationMonth: a.expirationMonth,
|
|
50
|
+
expirationYear: a.expirationYear,
|
|
51
|
+
CVV: a.CVV
|
|
52
|
+
} },
|
|
53
|
+
billingAddress: {
|
|
54
|
+
firstName: a.firstName,
|
|
55
|
+
lastName: a.lastName,
|
|
56
|
+
email: a.email,
|
|
57
|
+
country: a.country
|
|
58
|
+
}
|
|
59
|
+
}, function(e) {
|
|
60
|
+
window.postMessage({
|
|
61
|
+
status: "3ds_challenge_complete",
|
|
62
|
+
cres: e
|
|
63
|
+
}, "*");
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return (e, n) => (t(), c("div", d, [...n[0] ||= [s("div", { class: "wrapper" }, [s("div", { class: "container" })], -1)]]));
|
|
67
|
+
}
|
|
68
|
+
}), [["__scopeId", "data-v-3b52be97"]]), { hideSpinner: p } = o(), m = class extends u {
|
|
69
|
+
_paResPayload = null;
|
|
70
|
+
getType() {
|
|
71
|
+
return "Nuvei";
|
|
72
|
+
}
|
|
73
|
+
onPreAuth() {
|
|
74
|
+
this.log(`[${this.getType()}]: onPreAuth`), this.threeDsProcessor?.getTokenId() ? this.threeDsProcessor?.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e) => {
|
|
75
|
+
this.threeDsProcessor?.setPaymentInfo(e), super.onPreAuth();
|
|
76
|
+
}, () => {
|
|
77
|
+
l(this.container, "Unable to get card information");
|
|
78
|
+
}) : super.onPreAuth();
|
|
79
|
+
}
|
|
80
|
+
onPostAuth() {
|
|
81
|
+
this.log(`[${this.getType()}][onAuth] Do Post Authentication for transId`, this.threeDSServerTransID, this._paResPayload), this.threeDsProcessor?.onPostAuth({
|
|
82
|
+
threeDSServerTransID: this.threeDSServerTransID,
|
|
83
|
+
authenticationValue: this._paResPayload.cavv,
|
|
84
|
+
eci: this._paResPayload.eci,
|
|
85
|
+
dsTransID: this._paResPayload.dsTransID,
|
|
86
|
+
threeDsVersion: this._paResPayload.threeDVersion,
|
|
87
|
+
xid: this._paResPayload.xid
|
|
88
|
+
}, this.onSuccess, this.onError);
|
|
89
|
+
}
|
|
90
|
+
doNuveiChallenge(e, t, n) {
|
|
91
|
+
let r = JSON.parse(e);
|
|
92
|
+
(r === null || !r.merchantId || !r.merchantSiteId) && this.threeDsProcessor?.onError({ error: a }), t && (r.firstName = t.firstName, r.lastName = t.lastName, r.email = t.email, r.country = t.country), n && (r.cardNumber = n.cardNumber, r.cardHolderName = n.cardholder || "", r.expirationMonth = n.expiryDate.substring(2, 4), r.expirationYear = n.expiryDate.substring(0, 2), r.CVV = n.ccv), this.setChallengeFrameVisible(!0);
|
|
93
|
+
let { destroy: o } = i({
|
|
94
|
+
el: document.body,
|
|
95
|
+
component: f,
|
|
96
|
+
props: r,
|
|
97
|
+
on: { close: () => {
|
|
98
|
+
o(), this.setChallengeFrameVisible(!1), this.threeDSDestroy = () => {}, this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
|
|
99
|
+
} }
|
|
100
|
+
});
|
|
101
|
+
this.threeDSDestroy = o;
|
|
102
|
+
}
|
|
103
|
+
onSuccess = (e, t) => {
|
|
104
|
+
this.closeChallenge(), p();
|
|
105
|
+
let n = JSON.parse(t);
|
|
106
|
+
n.authenticationValue ? this.threeDsProcessor?.onSuccess(n) : (this.log(`[${this.getType()}][_onSuccess] ${a}`, n), this.threeDsProcessor?.onError({ error: a }));
|
|
107
|
+
};
|
|
108
|
+
onDoAuthSuccess = (e, t) => {
|
|
109
|
+
let n = JSON.parse(t);
|
|
110
|
+
if (this.log(`[${this.getType()}][onDoAuthSuccess]`, n), !n.transStatus || !n.authenticationValue) {
|
|
111
|
+
this.onError(e, "No transStatus specified");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
switch (n.transStatus) {
|
|
115
|
+
case "C":
|
|
116
|
+
this.doNuveiChallenge(n.authenticationValue, this.threeDsProcessor?.getAddressInfo(), this.threeDsProcessor?.getPaymentInfo());
|
|
117
|
+
break;
|
|
118
|
+
default: this.log(`[${this.getType()}][threeDsAuth], 3DS challenge not required, tranStatus: ` + n.transStatus), this.threeDsProcessor?.onSuccess({
|
|
119
|
+
threeDSServerTransID: n.threeDSServerTransID,
|
|
120
|
+
threeDSRequestorTransID: "",
|
|
121
|
+
acsRenderingType: n.acsRenderingType,
|
|
122
|
+
acsTransID: n.acsTransID,
|
|
123
|
+
authenticationType: n.authenticationType,
|
|
124
|
+
authenticationValue: n.authenticationValue,
|
|
125
|
+
challengeCancel: "",
|
|
126
|
+
dsTransID: n.dsTransID,
|
|
127
|
+
eci: n.eci,
|
|
128
|
+
interactionCounter: "",
|
|
129
|
+
messageCategory: "",
|
|
130
|
+
messageExtension: n.messageExtension,
|
|
131
|
+
messageType: n.messageType,
|
|
132
|
+
messageVersion: n.messageVersion,
|
|
133
|
+
transStatus: n.transStatus,
|
|
134
|
+
transStatusReason: n.transStatusReason
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
messageHandler(e) {
|
|
139
|
+
if (e?.data?.status) {
|
|
140
|
+
if (e.data.status === "3ds_method_invocation_complete") {
|
|
141
|
+
this.log(`[${this.getType()}][messageHandler] 3Ds Method invocation complete`), e.stopPropagation(), this.onAuth(!0, "");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
e.data.status === "3ds_challenge_complete" && (this.log(`[${this.getType()}][messageHandler] 3Ds Challenge complete`, e.data), e.stopPropagation(), this.closeChallenge(), e.data.cres && e.data.cres?.result === "APPROVED" && e.data.cres?.errCode === "0" ? (this._paResPayload = e.data.cres, this.onPostAuth()) : (this.log(`[${this.getType()}][messageHandler] Failed 3DS Challenge`, e.data), this.onError(400, "Failed 3DS Challenge")));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { m as NuveiThreeDsProvider };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Dt as e, Et as t, It as n, Nt as r, Ot as i, Tt as a, Z as o, _t as s, ct as c, dt as l, h as u, vt as d, xt as f } from "./CloseIcon-BJgZxU_4.js";
|
|
2
|
+
import { t as p } from "./alerts-Bad_5Z62.js";
|
|
3
|
+
import { t as m } from "./DefaultThreeDsProvider-aIZr-d29.js";
|
|
4
|
+
//#region src/iframe/setup/log.ts
|
|
5
|
+
var h = n(!1);
|
|
6
|
+
function g(e, ...t) {
|
|
7
|
+
h.value && console.log(e, t);
|
|
8
|
+
}
|
|
9
|
+
function _(e) {
|
|
10
|
+
e?.data?.status && e.data.status === "init-card-form" && (h.value = !!e?.data?.debug);
|
|
11
|
+
}
|
|
12
|
+
function v() {
|
|
13
|
+
return t(() => {
|
|
14
|
+
window.addEventListener("message", _);
|
|
15
|
+
}), e(() => {
|
|
16
|
+
window.removeEventListener("message", _);
|
|
17
|
+
}), {
|
|
18
|
+
debug: h,
|
|
19
|
+
logMessage: g
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/sdk/3ds/PayGLocalThreeDsChallenge.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
+
var y = { class: "modal-mask" }, b = { class: "modal-wrapper" }, x = ["src"], S = /*#__PURE__*/ o(/* @__PURE__ */ a({
|
|
25
|
+
__name: "PayGLocalThreeDsChallenge",
|
|
26
|
+
props: { url: {} },
|
|
27
|
+
emits: ["close"],
|
|
28
|
+
setup(a, { emit: o }) {
|
|
29
|
+
let { logMessage: l } = v(), u = a, p = o, m = n(u.url), h = s(() => c(m.value) ? m.value : "");
|
|
30
|
+
n(null), r(() => u.url, (e) => {
|
|
31
|
+
m.value = e;
|
|
32
|
+
}), t(() => {
|
|
33
|
+
window.addEventListener("message", g);
|
|
34
|
+
}), e(() => {
|
|
35
|
+
window.removeEventListener("message", g);
|
|
36
|
+
});
|
|
37
|
+
function g(e) {
|
|
38
|
+
if (l("PayGLocalThreeDsChallenge: Message received", e.data), !e?.data?.["payglocal-token"]) return;
|
|
39
|
+
let t = e.data["payglocal-token"];
|
|
40
|
+
l("Token received", t);
|
|
41
|
+
let n = t.split(".")[1], r = window.atob(n), i = JSON.parse(r);
|
|
42
|
+
p("close", i);
|
|
43
|
+
}
|
|
44
|
+
return (e, t) => (i(), f("div", y, [d("div", b, [d("iframe", {
|
|
45
|
+
src: h.value,
|
|
46
|
+
sandbox: "allow-same-origin allow-scripts allow-popups allow-forms"
|
|
47
|
+
}, null, 8, x)])]));
|
|
48
|
+
}
|
|
49
|
+
}), [["__scopeId", "data-v-0699f67d"]]), C = class extends m {
|
|
50
|
+
getType() {
|
|
51
|
+
return "PayGLocal";
|
|
52
|
+
}
|
|
53
|
+
onPreAuth() {
|
|
54
|
+
if (this.log(`[${this.getType()}]: onPreAuth`), this.threeDsProcessor?.getTokenId()) {
|
|
55
|
+
this.threeDsProcessor?.getCardDetails(this.threeDsProcessor.getProviderId(), this.threeDsProcessor.getTokenId(), (e, t) => {
|
|
56
|
+
this.log(`[${this.getType()}]: getCardDetails`, e, t), this.threeDsProcessor?.setPaymentInfo(e), this.initChallenge(t.RedirectUrl);
|
|
57
|
+
}, () => {
|
|
58
|
+
p(this.container, "Unable to get card information");
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.threeDsProcessor?.tokeniseCard(this.threeDsProcessor.getProviderId(), (e) => {
|
|
63
|
+
this.log(`[${this.getType()}]: tokeniseCard`, e), this.initChallenge(e.gatewayTokenData.RedirectUrl);
|
|
64
|
+
}, (e) => {
|
|
65
|
+
p(this.container, e);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
onAuth(e, t) {}
|
|
69
|
+
onPostAuth() {}
|
|
70
|
+
initChallenge(e) {
|
|
71
|
+
if (this.log(`[${this.getType()}]: initChallenge`, e), !e) {
|
|
72
|
+
p(this.container, "3D Secure URL is missing");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.setChallengeFrameVisible(!0);
|
|
76
|
+
let { destroy: t } = l({
|
|
77
|
+
el: document.body,
|
|
78
|
+
component: S,
|
|
79
|
+
props: { url: e },
|
|
80
|
+
on: { close: (e) => {
|
|
81
|
+
if (this.closeChallenge(), this.log(`[${this.getType()}]: Challenge Results`, e), e.status === "AUTHORIZED") {
|
|
82
|
+
this.threeDsProcessor?.onSuccess({
|
|
83
|
+
acsRenderingType: {},
|
|
84
|
+
acsTransID: "",
|
|
85
|
+
authenticationType: "",
|
|
86
|
+
authenticationValue: "",
|
|
87
|
+
challengeCancel: "",
|
|
88
|
+
dsTransID: "",
|
|
89
|
+
eci: "",
|
|
90
|
+
interactionCounter: "",
|
|
91
|
+
messageCategory: "",
|
|
92
|
+
messageExtension: [],
|
|
93
|
+
messageType: "",
|
|
94
|
+
messageVersion: "",
|
|
95
|
+
threeDSRequestorTransID: "",
|
|
96
|
+
threeDSServerTransID: "",
|
|
97
|
+
transStatusReason: "",
|
|
98
|
+
transStatus: "Y"
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (e.status === "CUSTOMER_CANCELLED") {
|
|
103
|
+
this.threeDsProcessor?.onError({ error: "Challenge cancelled" });
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.threeDsProcessor?.onError({ error: u });
|
|
107
|
+
} }
|
|
108
|
+
});
|
|
109
|
+
this.threeDSDestroy = t;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { C as PayGLocalThreeDsProvider };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { o as e, r as t, s as n } from "./strings-C1wc79_e.js";
|
|
2
|
+
//#region src/sdk/processors/applepay/PayWayAppleButton.ts
|
|
3
|
+
var r = {
|
|
4
|
+
CHECKOUT: "CHECKOUT",
|
|
5
|
+
CHARGE: "CHARGE"
|
|
6
|
+
}, i = (e) => ({
|
|
7
|
+
[r.CHECKOUT]: {
|
|
8
|
+
url: e + "/payment_method/checkout",
|
|
9
|
+
method: "POST"
|
|
10
|
+
},
|
|
11
|
+
[r.CHARGE]: {
|
|
12
|
+
url: e + "/charge/checkout",
|
|
13
|
+
method: "POST"
|
|
14
|
+
}
|
|
15
|
+
}), a = class {
|
|
16
|
+
log;
|
|
17
|
+
container;
|
|
18
|
+
button = null;
|
|
19
|
+
validator = null;
|
|
20
|
+
validationError = null;
|
|
21
|
+
providerId;
|
|
22
|
+
apiUrl;
|
|
23
|
+
amount;
|
|
24
|
+
currency;
|
|
25
|
+
clientParameters;
|
|
26
|
+
billingAddress = null;
|
|
27
|
+
customer = null;
|
|
28
|
+
order = null;
|
|
29
|
+
buttonId = "apple-pay-payway-button";
|
|
30
|
+
validatorId = "apple-pay-payway-button-validator";
|
|
31
|
+
onLoad = () => {};
|
|
32
|
+
onSuccess;
|
|
33
|
+
onFailure;
|
|
34
|
+
userOnValidate;
|
|
35
|
+
httpInvoker = null;
|
|
36
|
+
constructor(r, i, a, o, s, c) {
|
|
37
|
+
this.log = r, this.apiUrl = c.apiUrl, this.container = i || document.body, this.clientParameters = c.clientParameters, this.providerId = c.providerId, this.amount = Number(o), this.currency = s, this.providerId = a, this.onSuccess = c.onSuccess || null, this.onFailure = c.onFailure || null, this.userOnValidate = c.onValidate;
|
|
38
|
+
let l = new e(c.environment, t(c.publicKey));
|
|
39
|
+
this.httpInvoker = new n(c.publicKey, c.version, l), this.init(), setInterval(() => {
|
|
40
|
+
if (this.validator) {
|
|
41
|
+
if (this.userOnValidate?.() === !1) {
|
|
42
|
+
this.validator.style.display = "block";
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.validator.style.display = "none", this.validationError.style.display = "none";
|
|
46
|
+
}
|
|
47
|
+
}, 1e3);
|
|
48
|
+
}
|
|
49
|
+
draw() {
|
|
50
|
+
let e = () => {
|
|
51
|
+
this.onLoad = () => {};
|
|
52
|
+
let e = {
|
|
53
|
+
container: this.buttonId,
|
|
54
|
+
publishableApiKey: this.clientParameters.PublishableApiKey,
|
|
55
|
+
principalAmount: this.amount,
|
|
56
|
+
currency: String(this.currency).toLowerCase(),
|
|
57
|
+
buttonMode: "callback"
|
|
58
|
+
};
|
|
59
|
+
this.log("[createPaymentRequestButton]", e), window.payway.createPaymentRequestButton(e, (e, t) => {
|
|
60
|
+
if (this.log("[createPaymentRequestButton]", e, t), e) {
|
|
61
|
+
this.onFailure?.(e);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.checkout(t.singleUseTokenId);
|
|
65
|
+
}), this.addValidator();
|
|
66
|
+
};
|
|
67
|
+
window.payway ? e() : this.onLoad = e;
|
|
68
|
+
}
|
|
69
|
+
show() {
|
|
70
|
+
this.button && (this.button.style.display = "block");
|
|
71
|
+
}
|
|
72
|
+
hide() {
|
|
73
|
+
this.button && (this.button.style.display = "none");
|
|
74
|
+
}
|
|
75
|
+
init() {
|
|
76
|
+
let e = document.createElement("div");
|
|
77
|
+
e.id = this.buttonId, e.style.position = "relative", this.container.appendChild(e), this.button = e, this.initScript();
|
|
78
|
+
}
|
|
79
|
+
addValidator() {
|
|
80
|
+
if (document.getElementById(this.validatorId)) return;
|
|
81
|
+
let e = document.createElement("div");
|
|
82
|
+
e.id = this.validatorId, e.style.width = "100%", e.style.height = "100%", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.display = "none", this.button?.appendChild(e), this.validator = e;
|
|
83
|
+
}
|
|
84
|
+
initScript() {
|
|
85
|
+
let e = document.createElement("script");
|
|
86
|
+
e.src = "https://api.payway.com.au/rest/v1/payway.js", e.onload = () => {
|
|
87
|
+
this.onLoad && this.onLoad();
|
|
88
|
+
}, document.head.appendChild(e);
|
|
89
|
+
}
|
|
90
|
+
checkout(e) {
|
|
91
|
+
let t = {
|
|
92
|
+
providerId: this.providerId,
|
|
93
|
+
amount: this.amount,
|
|
94
|
+
currency: this.currency,
|
|
95
|
+
reference: this.order?.orderNumber,
|
|
96
|
+
options: { ProviderToken: e },
|
|
97
|
+
customer: {
|
|
98
|
+
firstName: this.customer?.firstName,
|
|
99
|
+
lastName: this.customer?.lastName,
|
|
100
|
+
email: this.customer?.email,
|
|
101
|
+
phone: this.customer?.phoneNumber,
|
|
102
|
+
billingAddress: this.billingAddress && {
|
|
103
|
+
name: `${this.billingAddress.firstName} ${this.billingAddress.lastName}`,
|
|
104
|
+
addressLine1: this.billingAddress.streetAddress,
|
|
105
|
+
addressLine2: this.billingAddress.streetAddress2,
|
|
106
|
+
suburb: this.billingAddress.city,
|
|
107
|
+
countryCode: this.billingAddress.country,
|
|
108
|
+
postcode: this.billingAddress.postalCode,
|
|
109
|
+
state: this.billingAddress.state
|
|
110
|
+
} || void 0
|
|
111
|
+
},
|
|
112
|
+
items: this.order && this.order.orderItems.map((e) => ({
|
|
113
|
+
name: e.name,
|
|
114
|
+
reference: e.sku,
|
|
115
|
+
quantity: Number(e.quantity),
|
|
116
|
+
amount: Number(e.unitPrice)
|
|
117
|
+
})) || []
|
|
118
|
+
};
|
|
119
|
+
this.log("[PayWayAppleButton][checkout]", t), this.httpInvoker?.invoke(i(this.apiUrl)[r.CHECKOUT].url, i(this.apiUrl)[r.CHECKOUT].method, JSON.stringify(t), (e, t) => {
|
|
120
|
+
this.log("[PayWayAppleButton][checkout]: successCheckoutHandler", e, t);
|
|
121
|
+
let n = JSON.parse(t), r = JSON.parse(window.atob(n.checkoutData));
|
|
122
|
+
this.log("[PayWayAppleButton][checkout]: decodedData", r), this.charge(r.checkoutId);
|
|
123
|
+
}, (e, t) => {
|
|
124
|
+
this.log("[PayWayAppleButton][checkout]: failureCheckoutHandler", e, t);
|
|
125
|
+
let n = JSON.parse(t);
|
|
126
|
+
this.onFailure?.({ error: n.message });
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
charge(e) {
|
|
130
|
+
this.log("[PayWayAppleButton][charge]", { checkoutId: e }), this.httpInvoker?.invoke(i(this.apiUrl)[r.CHARGE].url, i(this.apiUrl)[r.CHARGE].method, JSON.stringify({ checkoutId: e }), (e, t) => {
|
|
131
|
+
this.log("[PayWayAppleButton][charge]: successChargeHandler", e, t);
|
|
132
|
+
let n = JSON.parse(t);
|
|
133
|
+
this.onSuccess?.({ transactionId: n?.chargeId });
|
|
134
|
+
}, (e, t) => {
|
|
135
|
+
this.log("[PayWayAppleButton][charge]: failureChargeHandler", e, t);
|
|
136
|
+
let n = JSON.parse(t);
|
|
137
|
+
this.onFailure?.({ error: n.message });
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
redraw() {
|
|
141
|
+
this.button && (this.button.innerHTML = "", this.draw());
|
|
142
|
+
}
|
|
143
|
+
setAmount(e) {
|
|
144
|
+
this.log("[PayWayAppleButton][setAmount]", e), this.amount = e, this.redraw();
|
|
145
|
+
}
|
|
146
|
+
setCurrency(e) {
|
|
147
|
+
this.log("[PayWayAppleButton][setCurrency]", e), this.currency = e, this.redraw();
|
|
148
|
+
}
|
|
149
|
+
setCustomerInfo(e) {
|
|
150
|
+
this.log("[PayWayAppleButton][setCustomerInfo]", e), this.customer = { ...e };
|
|
151
|
+
}
|
|
152
|
+
setBillingAddress(e) {
|
|
153
|
+
this.log("[PayWayAppleButton][setBillingAddress]", e), this.billingAddress = { ...e };
|
|
154
|
+
}
|
|
155
|
+
setOrderInfo(e) {
|
|
156
|
+
this.log("[PayWayAppleButton][setOrderInfo]", e), this.order = { ...e };
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
//#endregion
|
|
160
|
+
export { a as PayWayAppleButton };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
|
|
2
|
+
//#region src/sdk/3ds/PayabliThreeDsProvider.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
getType() {
|
|
5
|
+
return "Payabli";
|
|
6
|
+
}
|
|
7
|
+
getDomain() {
|
|
8
|
+
return "centavo.transactiongateway.com";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as PayabliThreeDsProvider };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as e } from "./MetricsGlobalThreeDsProvider-D3x5hiTk.js";
|
|
2
|
+
//#region src/sdk/3ds/SkyBankThreeDsProvider.ts
|
|
3
|
+
var t = class extends e {
|
|
4
|
+
getType() {
|
|
5
|
+
return "SkyBank";
|
|
6
|
+
}
|
|
7
|
+
getDomain() {
|
|
8
|
+
return "secure.skybankgateway.com";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as SkyBankThreeDsProvider };
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/sdk/3ds/ThreeDsPostAuthResponse.type.ts
|
|
2
|
+
function e() {
|
|
3
|
+
return {
|
|
4
|
+
acsRenderingType: {
|
|
5
|
+
acsInterface: "",
|
|
6
|
+
acsUiTemplate: ""
|
|
7
|
+
},
|
|
8
|
+
acsTransID: "",
|
|
9
|
+
authenticationType: "",
|
|
10
|
+
authenticationValue: "",
|
|
11
|
+
challengeCancel: "",
|
|
12
|
+
dsTransID: "",
|
|
13
|
+
eci: "",
|
|
14
|
+
interactionCounter: "",
|
|
15
|
+
messageCategory: "",
|
|
16
|
+
messageExtension: [],
|
|
17
|
+
messageType: "",
|
|
18
|
+
messageVersion: "",
|
|
19
|
+
threeDSRequestorTransID: "",
|
|
20
|
+
threeDSServerTransID: "",
|
|
21
|
+
transStatus: "Y",
|
|
22
|
+
transStatusReason: ""
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { e as getEmptySuccessThreeDsPostAuthResponse };
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Bt as e, It as t, Ot as n, Tt as r, Z as i, bt as a, dt as o, gt as s, vt as c, xt as l } from "./CloseIcon-BJgZxU_4.js";
|
|
2
|
+
//#region src/sdk/components/Error.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = { class: "message" }, d = /*#__PURE__*/ i(/* @__PURE__ */ r({
|
|
4
|
+
__name: "Error",
|
|
5
|
+
props: { error: {} },
|
|
6
|
+
setup(r) {
|
|
7
|
+
let i = t(r.error);
|
|
8
|
+
return (t, r) => (n(), l("div", u, e(i.value), 1));
|
|
9
|
+
}
|
|
10
|
+
}), [["__scopeId", "data-v-ae4be0f9"]]), f = { class: "message" }, p = { key: 0 }, m = /*#__PURE__*/ i(/* @__PURE__ */ r({
|
|
11
|
+
__name: "Success",
|
|
12
|
+
props: {
|
|
13
|
+
message: {},
|
|
14
|
+
token: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["close"],
|
|
17
|
+
setup(t, { emit: r }) {
|
|
18
|
+
let i = t;
|
|
19
|
+
return (t, r) => (n(), l(s, null, [c("div", f, e(i.message), 1), i.token ? (n(), l("div", p, "TokenId = " + e(i.token), 1)) : a("", !0)], 64));
|
|
20
|
+
}
|
|
21
|
+
}), [["__scopeId", "data-v-6a4e1608"]]);
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/sdk/utils/alerts.ts
|
|
24
|
+
function h(e, t) {
|
|
25
|
+
e && o({
|
|
26
|
+
el: e,
|
|
27
|
+
component: d,
|
|
28
|
+
props: { error: t }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function g(e, t, n) {
|
|
32
|
+
e && o({
|
|
33
|
+
el: e,
|
|
34
|
+
component: m,
|
|
35
|
+
props: {
|
|
36
|
+
message: t,
|
|
37
|
+
...n || {}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { g as n, h as t };
|
package/dist/sdk/favicon.ico
CHANGED
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FORTER_DEVICE_INTEL_SCRIPT_B64 as e } from "./forterDeviceIntelScript-DdHZ7KLR.js";
|
|
2
|
+
//#region src/sdk/fraud/forter.ts
|
|
3
|
+
var t = "", n = "2e6515aa0b8e", r = "v1.2", i = "checkoutTools__script", a = `https://sdk.checkouttools.com/${r}/managedOrders.js`, o = (e, n, r, i, a, o, s, c, l) => JSON.stringify({
|
|
4
|
+
siteId: l.SiteId,
|
|
5
|
+
providerId: e,
|
|
6
|
+
amount: n,
|
|
7
|
+
currency: r,
|
|
8
|
+
paymentInformation: i,
|
|
9
|
+
paypalInformation: a,
|
|
10
|
+
customerInfo: {
|
|
11
|
+
firstName: o.firstName,
|
|
12
|
+
lastName: o.lastName,
|
|
13
|
+
email: o.email,
|
|
14
|
+
phone: o.phoneNumber
|
|
15
|
+
},
|
|
16
|
+
address: {
|
|
17
|
+
line1: s.streetAddress,
|
|
18
|
+
line2: s.streetAddress2,
|
|
19
|
+
city: s.city,
|
|
20
|
+
country: s.country,
|
|
21
|
+
postalCode: s.postalCode,
|
|
22
|
+
state: s.state
|
|
23
|
+
},
|
|
24
|
+
order: { items: c.orderItems.map((e) => ({
|
|
25
|
+
productCode: e.sku,
|
|
26
|
+
quantity: Number(e.quantity),
|
|
27
|
+
amount: Number(e.unitPrice)
|
|
28
|
+
})) },
|
|
29
|
+
connectionInformation: {
|
|
30
|
+
userAgent: navigator.userAgent,
|
|
31
|
+
cookie: t,
|
|
32
|
+
checkoutTime: Date.now()
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
function s(e, t, n) {
|
|
36
|
+
let r = window.checkoutTools?.managedOrders;
|
|
37
|
+
if (!r || typeof r.manageOrder != "function") {
|
|
38
|
+
n(/* @__PURE__ */ Error("Forter managedOrders script is not loaded"));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
r.manageOrder(e, { challengeContainer: t ?? null }, n);
|
|
42
|
+
}
|
|
43
|
+
function c() {
|
|
44
|
+
if (document.addEventListener("ftr:tokenReady", function(e) {
|
|
45
|
+
t = e.detail;
|
|
46
|
+
}), !document.getElementById(n)) {
|
|
47
|
+
let t = document.createElement("script");
|
|
48
|
+
t.type = "text/javascript", t.id = n, t.innerHTML = window.atob(e), document.getElementsByTagName("body")[0].appendChild(t);
|
|
49
|
+
}
|
|
50
|
+
if (!document.getElementById(i)) {
|
|
51
|
+
let e = document.createElement("script");
|
|
52
|
+
e.type = "text/javascript", e.id = i, e.setAttribute("data-site-id", n), e.src = a, document.getElementsByTagName("body")[0].appendChild(e);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
getFraudCheckData: o,
|
|
56
|
+
manageOrder: s
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { c as default };
|