@payfurl/react-plugin 1.0.5 → 1.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/{CxPayThreeDsProvider-qI6LA8iK-7hd6hU9V.js → CxPayThreeDsProvider-4BCpCsdK-5y-jJAUH.js} +1 -1
- package/dist/{DefaultThreeDsProvider-BKnpkX8X-Cz7DrRsl.js → DefaultThreeDsProvider-C8FSCo8b-Bifhwxc_.js} +9 -9
- package/dist/{EcentricThreeDsProvider-Dor61dsV-GhDmnDn-.js → EcentricThreeDsProvider-DMFPFtaO-B6oROY8T.js} +19 -19
- package/dist/{EpnaThreeDsProvider-6j4cBf2g-Cd_oxzGb.js → EpnaThreeDsProvider-B5S5hU_--Dsl9eOr2.js} +1 -1
- package/dist/{FlashBancThreeDsProvider-B1IMjfpm-DrqCM_Cb.js → FlashBancThreeDsProvider-luFjZ63i-BySOhThG.js} +1 -1
- package/dist/{GPaymentsThreeDsProvider-PKB94NB4-CNkJLCnl.js → GPaymentsThreeDsProvider-6qulsjP4-CfWQs-AG.js} +9 -9
- package/dist/{MetricsGlobalThreeDsProvider-CkIGiDkd-DUSl24lr.js → MetricsGlobalThreeDsProvider-CMbA70S4-DWNzNSwW.js} +37 -37
- package/dist/{NmiThreeDsProvider-CcMEqhmQ-CFas_kIM.js → NmiThreeDsProvider-CaDEfbnA-DS5gnDcf.js} +1 -1
- package/dist/{NuveiThreeDsProvider-CwXxM_h7-BITQd7Iq.js → NuveiThreeDsProvider-NHowIDoE-_Je2HZn5.js} +19 -19
- package/dist/{PayGLocalThreeDsProvider-sIfhhTia-CvvMuyyq.js → PayGLocalThreeDsProvider-BURFf-eJ-CffD4wbC.js} +13 -13
- package/dist/PayWayAppleButton-Kiqg1nWI-DlAdkLl4.js +157 -0
- package/dist/{PayabliThreeDsProvider-Dbril8Rp-3ZWzXe4X.js → PayabliThreeDsProvider-C6ourY3u-4S5vdBoa.js} +1 -1
- package/dist/{SkyBankThreeDsProvider-C07fNAvi-DkOg-Std.js → SkyBankThreeDsProvider-CocwPgj3-CSQSEtCI.js} +1 -1
- package/dist/{cxpay-CEQ4-BTN-DtdA08b6.js → cxpay-BCOYAnDK-BUEsu20K.js} +1 -1
- package/dist/{default-C_HQSLX4-DWKpaokp.js → default-B9fgGMCu-cvfbDfsL.js} +1 -1
- package/dist/{ecentric-BNc1h8Eo-wq39vDkR.js → ecentric-BdxLq2Fp-DpZS-ORt.js} +1 -1
- package/dist/{epna-B9Y2q1w--DGUu8ZJW.js → epna-VMfQGBHy-Db9GqDwv.js} +1 -1
- package/dist/{flashbanc-C0Ty8vp7-CIVRvn_D.js → flashbanc-C5_gW-Ru-BLtd2df2.js} +1 -1
- package/dist/{gpayments-rnHqXJDK-DoKIhXX0.js → gpayments-ta5TF0Vv-DjYWBYkx.js} +1 -1
- package/dist/{index-C07A5tMl.js → index-CwPndRAR.js} +5951 -5566
- package/dist/{metrics_global-B6yYoxRR-CP7W0f7G.js → metrics_global-B9vt1fuY-B-mFPkPv.js} +1 -1
- package/dist/nmi-7Noaj-hm-C8r_dvJq.js +7 -0
- package/dist/{nuvei-Bh2t9NPs-CeU1te1v.js → nuvei-BfNusJeN-C-yeYE1M.js} +1 -1
- package/dist/{payabli-NfqCrBOu-CjD5Swso.js → payabli-NvcAIz8a-CVrjJnVT.js} +1 -1
- package/dist/payfurl-react.es.js +1 -1
- package/dist/payfurl-react.umd.js +43 -24
- package/dist/{payglocal-D3sg1uGV-zrK77nM8.js → payglocal-XRSVL_Mu-xTaim_K3.js} +1 -1
- package/dist/payway_rest-DYhBIk_r-i9UWjHTv.js +7 -0
- package/dist/{skybank-CrMnPsZ3-Bz6P0PvB.js → skybank-CLI49-PQ-AY_KHOf-.js} +1 -1
- package/package.json +2 -2
- package/dist/PayWayAppleButton-BhhFv3LB-C565KkXF.js +0 -141
- package/dist/nmi-2JLTZ129-DlW8mhIU.js +0 -7
- package/dist/payway_rest-B7rIKWt2-BQ72GP3z.js +0 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfurl/react-plugin",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"description": "PayFURL React Plugin",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"preview": "vite preview"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@payfurl/client": "^4.6.
|
|
28
|
+
"@payfurl/client": "^4.6.29"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": "^18.3.1",
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { D as b, O as g, w as A } from "./index-C07A5tMl.js";
|
|
2
|
-
var v = Object.defineProperty, C = (a, t, i) => t in a ? v(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i, s = (a, t, i) => C(a, typeof t != "symbol" ? t + "" : t, i);
|
|
3
|
-
const h = {
|
|
4
|
-
CHECKOUT: "CHECKOUT",
|
|
5
|
-
CHARGE: "CHARGE"
|
|
6
|
-
}, y = (a) => ({
|
|
7
|
-
[h.CHECKOUT]: {
|
|
8
|
-
url: a + "/payment_method/checkout",
|
|
9
|
-
method: "POST"
|
|
10
|
-
},
|
|
11
|
-
[h.CHARGE]: {
|
|
12
|
-
url: a + "/charge/checkout",
|
|
13
|
-
method: "POST"
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
class k {
|
|
17
|
-
constructor(t, i, o, r, n, e) {
|
|
18
|
-
s(this, "log"), s(this, "container"), s(this, "button", null), s(this, "providerId"), s(this, "apiUrl"), s(this, "amount"), s(this, "currency"), s(this, "clientParameters"), s(this, "billingAddress", null), s(this, "customer", null), s(this, "order", null), s(this, "buttonId", "apple-pay-payway-button"), s(this, "onLoad", () => {
|
|
19
|
-
}), s(this, "onSuccess"), s(this, "onFailure"), s(this, "httpInvoker", null), this.log = t, this.apiUrl = e.apiUrl, this.container = i || document.body, this.clientParameters = e.clientParameters, this.providerId = e.providerId, this.amount = Number(r), this.currency = n, this.providerId = o, this.onSuccess = e.onSuccess || null, this.onFailure = e.onFailure || null;
|
|
20
|
-
const c = new b(e.environment, g(e.publicKey));
|
|
21
|
-
this.httpInvoker = new A(e.publicKey, e.version, c), this.init();
|
|
22
|
-
}
|
|
23
|
-
draw() {
|
|
24
|
-
const t = () => {
|
|
25
|
-
this.onLoad = () => {
|
|
26
|
-
};
|
|
27
|
-
const i = {
|
|
28
|
-
container: this.buttonId,
|
|
29
|
-
publishableApiKey: this.clientParameters.PublishableApiKey,
|
|
30
|
-
principalAmount: this.amount,
|
|
31
|
-
currency: String(this.currency).toLowerCase(),
|
|
32
|
-
buttonMode: "callback"
|
|
33
|
-
};
|
|
34
|
-
this.log("[createPaymentRequestButton]", i), window.payway.createPaymentRequestButton(i, (o, r) => {
|
|
35
|
-
var n;
|
|
36
|
-
if (this.log("[createPaymentRequestButton]", o, r), o) {
|
|
37
|
-
(n = this.onFailure) == null || n.call(this, o);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.checkout(r.singleUseTokenId);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
window.payway ? t() : this.onLoad = t;
|
|
44
|
-
}
|
|
45
|
-
show() {
|
|
46
|
-
this.button && (this.button.style.display = "block");
|
|
47
|
-
}
|
|
48
|
-
hide() {
|
|
49
|
-
this.button && (this.button.style.display = "none");
|
|
50
|
-
}
|
|
51
|
-
init() {
|
|
52
|
-
const t = document.createElement("div");
|
|
53
|
-
t.id = this.buttonId, this.container.appendChild(t), this.button = t, this.initScript();
|
|
54
|
-
}
|
|
55
|
-
initScript() {
|
|
56
|
-
const t = document.createElement("script");
|
|
57
|
-
t.src = "https://api.payway.com.au/rest/v1/payway.js", t.onload = () => {
|
|
58
|
-
this.onLoad && this.onLoad();
|
|
59
|
-
}, document.head.appendChild(t);
|
|
60
|
-
}
|
|
61
|
-
checkout(t) {
|
|
62
|
-
var i, o, r, n, e, c;
|
|
63
|
-
const m = {
|
|
64
|
-
providerId: this.providerId,
|
|
65
|
-
amount: this.amount,
|
|
66
|
-
currency: this.currency,
|
|
67
|
-
reference: (i = this.order) == null ? void 0 : i.orderNumber,
|
|
68
|
-
options: {
|
|
69
|
-
ProviderToken: t
|
|
70
|
-
},
|
|
71
|
-
customer: {
|
|
72
|
-
firstName: (o = this.customer) == null ? void 0 : o.firstName,
|
|
73
|
-
lastName: (r = this.customer) == null ? void 0 : r.lastName,
|
|
74
|
-
email: (n = this.customer) == null ? void 0 : n.email,
|
|
75
|
-
phone: (e = this.customer) == null ? void 0 : e.phoneNumber,
|
|
76
|
-
billingAddress: this.billingAddress && {
|
|
77
|
-
name: `${this.billingAddress.firstName} ${this.billingAddress.lastName}`,
|
|
78
|
-
addressLine1: this.billingAddress.streetAddress,
|
|
79
|
-
addressLine2: this.billingAddress.streetAddress2,
|
|
80
|
-
suburb: this.billingAddress.city,
|
|
81
|
-
countryCode: this.billingAddress.country,
|
|
82
|
-
postcode: this.billingAddress.postalCode,
|
|
83
|
-
state: this.billingAddress.state
|
|
84
|
-
} || void 0
|
|
85
|
-
},
|
|
86
|
-
items: this.order && this.order.orderItems.map((l) => ({
|
|
87
|
-
name: l.name,
|
|
88
|
-
reference: l.sku,
|
|
89
|
-
quantity: Number(l.quantity),
|
|
90
|
-
amount: Number(l.unitPrice)
|
|
91
|
-
})) || []
|
|
92
|
-
};
|
|
93
|
-
this.log("[PayWayAppleButton][checkout]", m), (c = this.httpInvoker) == null || c.invoke(y(this.apiUrl)[h.CHECKOUT].url, y(this.apiUrl)[h.CHECKOUT].method, JSON.stringify(m), (l, u) => {
|
|
94
|
-
this.log("[PayWayAppleButton][checkout]: successCheckoutHandler", l, u);
|
|
95
|
-
const d = JSON.parse(u), p = JSON.parse(window.atob(d.checkoutData));
|
|
96
|
-
this.log("[PayWayAppleButton][checkout]: decodedData", p), this.charge(p.checkoutId);
|
|
97
|
-
}, (l, u) => {
|
|
98
|
-
var d;
|
|
99
|
-
this.log("[PayWayAppleButton][checkout]: failureCheckoutHandler", l, u);
|
|
100
|
-
const p = JSON.parse(u);
|
|
101
|
-
(d = this.onFailure) == null || d.call(this, { error: p.message });
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
charge(t) {
|
|
105
|
-
var i;
|
|
106
|
-
this.log("[PayWayAppleButton][charge]", { checkoutId: t }), (i = this.httpInvoker) == null || i.invoke(y(this.apiUrl)[h.CHARGE].url, y(this.apiUrl)[h.CHARGE].method, JSON.stringify({ checkoutId: t }), (o, r) => {
|
|
107
|
-
var n;
|
|
108
|
-
this.log("[PayWayAppleButton][charge]: successChargeHandler", o, r);
|
|
109
|
-
const e = JSON.parse(r);
|
|
110
|
-
(n = this.onSuccess) == null || n.call(this, {
|
|
111
|
-
transactionId: e == null ? void 0 : e.chargeId
|
|
112
|
-
});
|
|
113
|
-
}, (o, r) => {
|
|
114
|
-
var n;
|
|
115
|
-
this.log("[PayWayAppleButton][charge]: failureChargeHandler", o, r);
|
|
116
|
-
const e = JSON.parse(r);
|
|
117
|
-
(n = this.onFailure) == null || n.call(this, { error: e.message });
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
redraw() {
|
|
121
|
-
this.button && (this.button.innerHTML = "", this.draw());
|
|
122
|
-
}
|
|
123
|
-
setAmount(t) {
|
|
124
|
-
this.log("[PayWayAppleButton][setAmount]", t), this.amount = t, this.redraw();
|
|
125
|
-
}
|
|
126
|
-
setCurrency(t) {
|
|
127
|
-
this.log("[PayWayAppleButton][setCurrency]", t), this.currency = t, this.redraw();
|
|
128
|
-
}
|
|
129
|
-
setCustomerInfo(t) {
|
|
130
|
-
this.log("[PayWayAppleButton][setCustomerInfo]", t), this.customer = { ...t };
|
|
131
|
-
}
|
|
132
|
-
setBillingAddress(t) {
|
|
133
|
-
this.log("[PayWayAppleButton][setBillingAddress]", t), this.billingAddress = { ...t };
|
|
134
|
-
}
|
|
135
|
-
setOrderInfo(t) {
|
|
136
|
-
this.log("[PayWayAppleButton][setOrderInfo]", t), this.order = { ...t };
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
export {
|
|
140
|
-
k as PayWayAppleButton
|
|
141
|
-
};
|