@achyutlabsau/vue-payment-gateway 0.19.0 → 1.0.0-beta.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.
Files changed (42) hide show
  1. package/dist/PBtn-B_JOD69N.js +38 -0
  2. package/dist/PairInstructions-CzbeFfD_.js +45 -0
  3. package/dist/core-ExhZA5wz.js +215 -0
  4. package/dist/index.d.ts +587 -0
  5. package/dist/index.js +80 -69
  6. package/dist/linkly-DJIQ0uir.js +613 -0
  7. package/dist/linkly.d.ts +29 -3
  8. package/dist/linkly.js +2 -2
  9. package/dist/logger-c0YCqJje.js +589 -0
  10. package/dist/logger.d.ts +1760 -0
  11. package/dist/logger.js +2 -0
  12. package/dist/mx51-Cx-QU9ms.js +621 -0
  13. package/dist/mx51.js +1 -1
  14. package/dist/smartpay-DAyaqvId.js +313 -0
  15. package/dist/smartpay.d.ts +197 -26
  16. package/dist/smartpay.js +2 -2
  17. package/dist/{till-payment-Cpoq8EVJ.js → till-payment-ooytbfnP.js} +219 -183
  18. package/dist/till-payment.d.ts +37 -15
  19. package/dist/till-payment.js +2 -2
  20. package/dist/tyro-SIziM17_.js +228 -0
  21. package/dist/tyro.d.ts +8 -14
  22. package/dist/tyro.js +2 -2
  23. package/dist/utils.d.ts +1337 -0
  24. package/dist/utils.js +38 -0
  25. package/dist/valpay-D8GbM2Iv.js +769 -0
  26. package/dist/valpay.d.ts +176 -28
  27. package/dist/valpay.js +1 -1
  28. package/dist/worldline-BHzSNXMN.js +457 -0
  29. package/dist/worldline.d.ts +467 -0
  30. package/dist/worldline.js +2 -2
  31. package/package.json +19 -3
  32. package/dist/PBtn-CB98SoO5.js +0 -19
  33. package/dist/PairInstructions-CVnT81Id.js +0 -65
  34. package/dist/core-BMUVlh-t.js +0 -109
  35. package/dist/linkly-kVIcGvAk.js +0 -544
  36. package/dist/mx51-FCR8P_qa.js +0 -621
  37. package/dist/smartpay-sB9Pt9PZ.js +0 -269
  38. package/dist/tyro-DvHhgqHe.js +0 -242
  39. package/dist/utils-BPFf60Ai.js +0 -21
  40. package/dist/utils-CAwJtwP_.js +0 -33
  41. package/dist/valpay-DoVz604A.js +0 -582
  42. package/dist/worldline-DRyAhSeD.js +0 -512
@@ -0,0 +1,38 @@
1
+ import { createBlock as e, defineComponent as t, openBlock as n, reactive as r, ref as i, unref as a } from "vue";
2
+ import { QBtn as o } from "quasar";
3
+ //#region src/plugin/state.ts
4
+ var s = /* @__PURE__ */ function(e) {
5
+ return e.Tyro = "tyro", e.TillPayment = "till-instore", e.MX51 = "mx51-spi", e.Linkly = "linkly", e.SmartPay = "smartpay", e.ANZ = "anz-instore", e.ADYEN = "adyen-instore", e;
6
+ }({}), c = r({
7
+ productName: "",
8
+ productVersion: "",
9
+ productVendorName: "",
10
+ posId: "",
11
+ posRegisterId: "",
12
+ posRegisterName: "",
13
+ posBusinessName: "",
14
+ tyroApiKey: "",
15
+ tillPaymentApiKey: "",
16
+ tillPaymentMerchantId: "",
17
+ mx51DeviceApiKey: "",
18
+ apiBaseUrl: ""
19
+ }), l = i("AUD"), u = i("production"), d = i(!1), f = (e) => {
20
+ e.productName && (c.productName = e.productName), e.productVersion && (c.productVersion = e.productVersion), e.productVendorName && (c.productVendorName = e.productVendorName), e.posId && (c.posId = e.posId), e.posRegisterId && (c.posRegisterId = e.posRegisterId), e.posRegisterName && (c.posRegisterName = e.posRegisterName), e.posBusinessName && (c.posBusinessName = e.posBusinessName), e.tyroApiKey && (c.tyroApiKey = e.tyroApiKey), e.tillPaymentApiKey && (c.tillPaymentApiKey = e.tillPaymentApiKey), e.tillPaymentMerchantId && (c.tillPaymentMerchantId = e.tillPaymentMerchantId), e.mx51DeviceApiKey && (c.mx51DeviceApiKey = e.mx51DeviceApiKey), e.apiBaseUrl && (c.apiBaseUrl = e.apiBaseUrl);
21
+ }, p = (e) => l.value = e, m = (e) => u.value = e, h = () => {
22
+ if (d.value) return !0;
23
+ throw Error("[Vue Payment Gateway] Plugin is not initialized.");
24
+ }, g = /* @__PURE__ */ t({
25
+ __name: "PBtn",
26
+ setup(t) {
27
+ return (t, r) => (n(), e(a(o), {
28
+ label: "Cancel",
29
+ color: "primary",
30
+ size: "16px",
31
+ class: "!py-2.5",
32
+ unelevated: "",
33
+ ripple: !1
34
+ }));
35
+ }
36
+ });
37
+ //#endregion
38
+ export { u as a, m as c, l as i, f as l, s as n, d as o, h as r, p as s, g as t, c as u };
@@ -0,0 +1,45 @@
1
+ import { t as e } from "./PBtn-B_JOD69N.js";
2
+ import { Fragment as t, createBlock as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, openBlock as s, renderList as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
3
+ import { QCard as f, QIcon as p } from "quasar";
4
+ //#region node_modules/@quasar/extras/exports/mdi-v7/index.js
5
+ var m = "M2,6H4V18H2V6M5,6H6V18H5V6M7,6H10V18H7V6M11,6H12V18H11V6M14,6H16V18H14V6M17,6H20V18H17V6M21,6H22V18H21V6Z", h = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z", g = "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z", _ = "M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z", v = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", y = "M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z", b = "M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z", x = { class: "mb-8 space-y-4" }, S = { class: "flex items-center justify-center" }, C = { class: "mb-8 space-y-4" }, w = { class: "h-8 w-8 bg-gray-100 font-semibold dark:bg-gray-700 flex shrink-0 items-center justify-center rounded-full" }, T = { class: "text-gray-700 dark:text-gray-200" }, E = { class: "mb-6 space-x-3 rounded-lg bg-amber-50 p-4 text-base dark:bg-slate-700 flex items-start" }, D = { class: "flex justify-end" }, O = /* @__PURE__ */ o({
6
+ __name: "PairInstructions",
7
+ props: { steps: {} },
8
+ emits: ["next"],
9
+ setup(o) {
10
+ return (m, h) => (s(), n(u(f), {
11
+ class: "rounded-lg p-6",
12
+ flat: "",
13
+ bordered: ""
14
+ }, {
15
+ default: d(() => [
16
+ i("div", x, [
17
+ i("div", S, [a(u(p), {
18
+ name: u(_),
19
+ size: "4rem",
20
+ class: "text-primary"
21
+ }, null, 8, ["name"])]),
22
+ h[1] ||= i("h2", { class: "text-2xl !font-medium text-center" }, "Terminal Setup Instructions", -1),
23
+ h[2] ||= i("p", { class: "text-base text-gray-600 dark:text-gray-200 text-center" }, " Please follow these steps to pair your terminal ", -1)
24
+ ]),
25
+ i("ul", C, [(s(!0), r(t, null, c(o.steps, (e, t) => (s(), r("li", {
26
+ key: t,
27
+ class: "space-x-3 text-base flex flex-nowrap items-center"
28
+ }, [i("span", w, l(t + 1), 1), i("span", T, l(e), 1)]))), 128))]),
29
+ i("div", E, [a(u(p), {
30
+ name: u(v),
31
+ size: "md",
32
+ class: "mt-0.5 text-amber-500 dark:text-white"
33
+ }, null, 8, ["name"]), h[3] ||= i("div", { class: "flex-1" }, [i("div", { class: "font-medium text-amber-800 dark:text-white" }, "Important Note"), i("div", { class: "text-amber-700 dark:text-gray-300" }, " Please refer to your terminal guide for the most up-to-date instructions. ")], -1)]),
34
+ i("div", D, [a(e, {
35
+ "icon-right": "chevron_right",
36
+ label: "Next",
37
+ onClick: h[0] ||= (e) => m.$emit("next")
38
+ })])
39
+ ]),
40
+ _: 1
41
+ }));
42
+ }
43
+ });
44
+ //#endregion
45
+ export { y as a, g as i, m as n, b as o, h as r, O as t };
@@ -0,0 +1,215 @@
1
+ import { t as e } from "./PBtn-B_JOD69N.js";
2
+ import { createBlock as t, createCommentVNode as n, createElementVNode as r, createVNode as i, defineComponent as a, openBlock as o, resolveDirective as s, toDisplayString as c, unref as l, withCtx as u, withDirectives as d } from "vue";
3
+ import { Dialog as f, QCard as p, QCardSection as m, QDialog as h, QSpinnerHourglass as g, useDialogPluginComponent as _ } from "quasar";
4
+ //#region src/core/types.ts
5
+ var v = /* @__PURE__ */ function(e) {
6
+ return e.Approved = "approved", e.Declined = "declined", e.Cancelled = "cancelled", e.Failed = "failed", e.Timeout = "timeout", e;
7
+ }({});
8
+ function y(e) {
9
+ return {
10
+ transactionId: null,
11
+ amount: null,
12
+ tipAmount: null,
13
+ surchargeAmount: null,
14
+ maskedCard: null,
15
+ cardScheme: null,
16
+ receipts: {},
17
+ raw: null,
18
+ ...e,
19
+ success: e.status === "approved"
20
+ };
21
+ }
22
+ //#endregion
23
+ //#region src/components/PairDialog.vue?vue&type=script&setup=true&lang.ts
24
+ var b = { class: "text-lg font-semibold text-gray-500 text-center uppercase" }, x = { class: "!mt-2 text-base text-gray-800 dark:text-gray-300 text-center" }, S = { class: "!mt-2 text-base text-gray-800 dark:text-gray-300 text-center" }, C = /* @__PURE__ */ a({
25
+ __name: "PairDialog",
26
+ props: {
27
+ message: {},
28
+ title: {},
29
+ cancelPairing: { type: Function }
30
+ },
31
+ emits: [..._.emits],
32
+ setup(a) {
33
+ let { dialogRef: f, onDialogHide: v } = _();
34
+ return (_, y) => {
35
+ let C = s("close-popup");
36
+ return o(), t(l(h), {
37
+ ref_key: "dialogRef",
38
+ ref: f,
39
+ onHide: l(v),
40
+ persistent: ""
41
+ }, {
42
+ default: u(() => [i(l(p), { class: "q-dialog-plugin px-6 py-3" }, {
43
+ default: u(() => [a.title === "INPROGRESS" ? (o(), t(l(m), {
44
+ key: 0,
45
+ class: "text-center"
46
+ }, {
47
+ default: u(() => [
48
+ i(l(g), {
49
+ color: "amber",
50
+ size: "3rem",
51
+ class: "!mb-4"
52
+ }),
53
+ r("div", b, c(a.message), 1),
54
+ i(e, {
55
+ label: "Cancel",
56
+ onClick: a.cancelPairing,
57
+ color: "primary",
58
+ outline: "",
59
+ class: "!mt-6 !w-full"
60
+ }, null, 8, ["onClick"])
61
+ ]),
62
+ _: 1
63
+ })) : a.title === "SUCCESS" ? (o(), t(l(m), { key: 1 }, {
64
+ default: u(() => [
65
+ y[0] ||= r("div", { class: "text-lg font-semibold text-green-500 text-center uppercase" }, "Success!", -1),
66
+ r("div", x, c(a.message), 1),
67
+ d(i(e, {
68
+ label: "OK",
69
+ color: "primary",
70
+ outline: "",
71
+ class: "!mt-6 !w-full"
72
+ }, null, 512), [[C]])
73
+ ]),
74
+ _: 1
75
+ })) : a.title === "FAILED" ? (o(), t(l(m), { key: 2 }, {
76
+ default: u(() => [
77
+ y[1] ||= r("div", { class: "text-lg font-semibold text-red-500 text-center uppercase" }, "Failed!", -1),
78
+ r("div", S, c(a.message), 1),
79
+ d(i(e, {
80
+ label: "OK",
81
+ color: "primary",
82
+ outline: "",
83
+ class: "!mt-6 !w-full"
84
+ }, null, 512), [[C]])
85
+ ]),
86
+ _: 1
87
+ })) : n("", !0)]),
88
+ _: 1
89
+ })]),
90
+ _: 1
91
+ }, 8, ["onHide"]);
92
+ };
93
+ }
94
+ }), w = { class: "text-lg font-semibold text-gray-500 text-center uppercase" }, T = { class: "text-lg font-semibold text-gray-500 text-center uppercase" }, E = { class: "text-lg font-semibold text-gray-500 text-center uppercase" }, D = /* @__PURE__ */ a({
95
+ __name: "TransactionDialog",
96
+ props: {
97
+ message: {},
98
+ title: {},
99
+ cancelTxn: { type: Function }
100
+ },
101
+ emits: [..._.emits],
102
+ setup(a) {
103
+ let { dialogRef: f, onDialogHide: g } = _();
104
+ return (_, v) => {
105
+ let y = s("close-popup");
106
+ return o(), t(l(h), {
107
+ ref_key: "dialogRef",
108
+ ref: f,
109
+ onHide: l(g),
110
+ persistent: ""
111
+ }, {
112
+ default: u(() => [i(l(p), { class: "q-dialog-plugin px-6 py-3" }, {
113
+ default: u(() => [a.title === "INPROGRESS" ? (o(), t(l(m), { key: 0 }, {
114
+ default: u(() => [r("div", w, c(a.message), 1), i(e, {
115
+ label: "Cancel",
116
+ onClick: a.cancelTxn,
117
+ color: "primary",
118
+ outline: "",
119
+ class: "!mt-6 !w-full"
120
+ }, null, 8, ["onClick"])]),
121
+ _: 1
122
+ })) : a.title === "SUCCESS" ? (o(), t(l(m), { key: 1 }, {
123
+ default: u(() => [r("div", T, c(a.message), 1), d(i(e, {
124
+ label: "OK",
125
+ color: "primary",
126
+ outline: "",
127
+ class: "!mt-6 !w-full"
128
+ }, null, 512), [[y]])]),
129
+ _: 1
130
+ })) : a.title === "FAILED" ? (o(), t(l(m), { key: 2 }, {
131
+ default: u(() => [r("div", E, c(a.message), 1), d(i(e, {
132
+ label: "OK",
133
+ color: "primary",
134
+ outline: "",
135
+ class: "!mt-6 !w-full"
136
+ }, null, 512), [[y]])]),
137
+ _: 1
138
+ })) : n("", !0)]),
139
+ _: 1
140
+ })]),
141
+ _: 1
142
+ }, 8, ["onHide"]);
143
+ };
144
+ }
145
+ });
146
+ //#endregion
147
+ //#region src/core/dialog.ts
148
+ function O(e) {
149
+ let t = e.successHideDelay ?? 1e3, n = f.create({
150
+ component: D,
151
+ componentProps: {
152
+ title: "INPROGRESS",
153
+ message: e.message,
154
+ cancelTxn: () => e.onCancel?.()
155
+ }
156
+ }), r = (e) => n.update({
157
+ title: "INPROGRESS",
158
+ message: e
159
+ }), i = (e = "Transaction Accepted!") => {
160
+ n.update({
161
+ title: "SUCCESS",
162
+ message: e
163
+ }), setTimeout(() => n.hide(), t);
164
+ }, a = (e = "Transaction Failed!") => n.update({
165
+ title: "FAILED",
166
+ message: e
167
+ });
168
+ return {
169
+ progress: r,
170
+ success: i,
171
+ failed: a,
172
+ settle: (e, t) => {
173
+ e === v.Approved ? i(t) : a(t);
174
+ },
175
+ hide: () => n.hide(),
176
+ hideAfter: (e = t) => {
177
+ setTimeout(() => n.hide(), e);
178
+ }
179
+ };
180
+ }
181
+ function k(e = {}) {
182
+ let { message: t = "Pairing in progress...", onCancel: n, successHideDelay: r = 3e3 } = typeof e == "string" ? { message: e } : e, i = f.create({
183
+ component: C,
184
+ componentProps: {
185
+ title: "INPROGRESS",
186
+ message: t,
187
+ cancelPairing: () => n?.()
188
+ }
189
+ }), a = (e) => i.update({
190
+ title: "INPROGRESS",
191
+ message: e
192
+ }), o = (e = r) => {
193
+ setTimeout(() => i.hide(), e);
194
+ }, s = (e = "Paired successfully!") => {
195
+ i.update({
196
+ title: "SUCCESS",
197
+ message: e
198
+ }), o();
199
+ }, c = (e = "Pairing failed!") => i.update({
200
+ title: "FAILED",
201
+ message: e
202
+ });
203
+ return {
204
+ progress: a,
205
+ success: s,
206
+ failed: c,
207
+ settle: (e, t) => {
208
+ e === "inProgress" ? a(t ?? "") : e === "success" ? s(t) : c(t);
209
+ },
210
+ hide: () => i.hide(),
211
+ hideAfter: o
212
+ };
213
+ }
214
+ //#endregion
215
+ export { y as i, O as n, v as r, k as t };