@achyutlabsau/vue-payment-gateway 0.15.0 → 0.15.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/{core-nvcK0Nr9.js → core-BMUVlh-t.js} +2 -0
- package/dist/index.js +5 -5
- package/dist/{linkly-yernhu9V.js → linkly-D3mav3HW.js} +91 -83
- package/dist/linkly.d.ts +4 -0
- package/dist/linkly.js +1 -1
- package/dist/{smartpay-BSvt0cIh.js → smartpay-Be3u1f3L.js} +4 -2
- package/dist/smartpay.d.ts +10 -0
- package/dist/smartpay.js +1 -1
- package/dist/{till-payment-DSScmuag.js → till-payment-C1iLnYV7.js} +119 -117
- package/dist/till-payment.d.ts +12 -0
- package/dist/till-payment.js +1 -1
- package/dist/{utils-LqvcWjKL.js → utils-o5X3364V.js} +5 -2
- package/dist/{valpay--SOqhe0M.js → valpay-DVV1AH4F.js} +4 -2
- package/dist/valpay.d.ts +12 -0
- package/dist/valpay.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { d as e, f as t, m as n, p as r, s as i } from "./PairInstructions-Bxziv
|
|
|
2
2
|
import { i as a, t as o } from "./tyro-CfOu7q7t.js";
|
|
3
3
|
import { f as s, m as c } from "./mx51-Df356gl0.js";
|
|
4
4
|
import { a as l, i as u, r as d } from "./worldline-CEiMow5_.js";
|
|
5
|
-
import { n as f } from "./utils-
|
|
6
|
-
import { t as p } from "./linkly-
|
|
7
|
-
import { t as m } from "./smartpay-
|
|
8
|
-
import { t as h } from "./till-payment-
|
|
9
|
-
import { t as g } from "./valpay
|
|
5
|
+
import { n as f } from "./utils-o5X3364V.js";
|
|
6
|
+
import { t as p } from "./linkly-D3mav3HW.js";
|
|
7
|
+
import { t as m } from "./smartpay-Be3u1f3L.js";
|
|
8
|
+
import { t as h } from "./till-payment-C1iLnYV7.js";
|
|
9
|
+
import { t as g } from "./valpay-DVV1AH4F.js";
|
|
10
10
|
import { createBlock as _, createCommentVNode as v, createElementBlock as y, defineComponent as b, openBlock as x, unref as S } from "vue";
|
|
11
11
|
import { useEventListener as C, useScriptTag as w } from "@vueuse/core";
|
|
12
12
|
//#region src/plugin/types.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as e, h as t, i as n, o as r, r as i, t as a, u as o } from "./PairInstructions-BxzivULm.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { createBlock as
|
|
6
|
-
import { Dialog as
|
|
7
|
-
import { useLocalStorage as
|
|
2
|
+
import { a as s, i as c, n as l, r as u, t as d } from "./utils-o5X3364V.js";
|
|
3
|
+
import { t as f } from "./utils-BPFf60Ai.js";
|
|
4
|
+
import { t as p } from "./core-BMUVlh-t.js";
|
|
5
|
+
import { createBlock as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, onMounted as ee, openBlock as b, ref as x, renderSlot as S, resolveDirective as C, toDisplayString as w, unref as T, useModel as E, withCtx as D, withDirectives as O } from "vue";
|
|
6
|
+
import { Dialog as te, Loading as k, Notify as A, QBtn as j, QCard as M, QCardActions as ne, QCardSection as re, QDialog as ie, QForm as N, QIcon as P, QInput as F, QToolbar as ae, QToolbarTitle as oe } from "quasar";
|
|
7
|
+
import { useLocalStorage as se } from "@vueuse/core";
|
|
8
8
|
import { v7 as I } from "uuid";
|
|
9
|
-
import L, { HttpStatusCode as R, isAxiosError as
|
|
9
|
+
import L, { HttpStatusCode as R, isAxiosError as ce } from "axios";
|
|
10
10
|
//#region src/library/linkly/linkly.config.ts
|
|
11
11
|
var z = {
|
|
12
12
|
PATHS: {
|
|
@@ -36,7 +36,7 @@ var z = {
|
|
|
36
36
|
BASE: "https://rest.pos.cloud.pceftpos.com/v1/sessions/"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
}, B = { async: !1 }, V = 18e4, H = 2e3, U = 1e3, { PATHS: W, STORAGE_KEYS: G } = z,
|
|
39
|
+
}, B = { async: !1 }, V = 18e4, H = 2e3, U = 1e3, { PATHS: W, STORAGE_KEYS: G } = z, le = class {
|
|
40
40
|
_api;
|
|
41
41
|
_authApi;
|
|
42
42
|
token = null;
|
|
@@ -63,7 +63,7 @@ var z = {
|
|
|
63
63
|
}
|
|
64
64
|
_getErrorMessage(e, t) {
|
|
65
65
|
let n = t ?? "An unexpected error occurred.";
|
|
66
|
-
if (
|
|
66
|
+
if (ce(e)) {
|
|
67
67
|
let t = e.response?.status;
|
|
68
68
|
switch (t) {
|
|
69
69
|
case R.Unauthorized:
|
|
@@ -75,9 +75,9 @@ var z = {
|
|
|
75
75
|
case R.RequestTimeout:
|
|
76
76
|
n = "Request Timeout. This should be rare: a transient error has occurred, possibly due to server overloading.";
|
|
77
77
|
break;
|
|
78
|
-
default:
|
|
78
|
+
default: c(t) && (n = "A server error has occurred. Wait a few seconds and attempt the request again. If the problem persists, contact Linkly Support.");
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
u(e) && (n = "You are not connected to the internet");
|
|
81
81
|
}
|
|
82
82
|
return n;
|
|
83
83
|
}
|
|
@@ -140,7 +140,7 @@ var z = {
|
|
|
140
140
|
} catch {
|
|
141
141
|
throw Error("Failed to authenticate. Please check your Linkly account credentials.", { cause: n });
|
|
142
142
|
}
|
|
143
|
-
if (r === R.RequestTimeout ||
|
|
143
|
+
if (r === R.RequestTimeout || c(n)) return this.getTransactionStatus(t);
|
|
144
144
|
}
|
|
145
145
|
throw n;
|
|
146
146
|
}
|
|
@@ -153,8 +153,8 @@ var z = {
|
|
|
153
153
|
} catch (e) {
|
|
154
154
|
if (L.isAxiosError(e)) {
|
|
155
155
|
let r = e.response?.status ?? 0;
|
|
156
|
-
if (r === R.RequestTimeout ||
|
|
157
|
-
if (t < V) return await
|
|
156
|
+
if (r === R.RequestTimeout || c(e)) {
|
|
157
|
+
if (t < V) return await d(H), t = Math.min(t + U, V), n();
|
|
158
158
|
throw Error("Unable to get the transaction details. Please contact service provider!", { cause: e });
|
|
159
159
|
} else if (r === R.Unauthorized) return await this.getLinklyAuthToken(), n();
|
|
160
160
|
}
|
|
@@ -190,7 +190,7 @@ var z = {
|
|
|
190
190
|
data: null
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
if (n === R.RequestTimeout ||
|
|
193
|
+
if (n === R.RequestTimeout || c(t)) return await d(), this.reprintReceipt(e);
|
|
194
194
|
}
|
|
195
195
|
return {
|
|
196
196
|
success: !1,
|
|
@@ -219,7 +219,7 @@ var z = {
|
|
|
219
219
|
message: "Failed to authenticate. Please check your Linkly account credentials."
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
if (n === R.RequestTimeout ||
|
|
222
|
+
if (n === R.RequestTimeout || c(t)) return await d(), this.sendKey(e);
|
|
223
223
|
}
|
|
224
224
|
return {
|
|
225
225
|
success: !1,
|
|
@@ -240,15 +240,15 @@ var z = {
|
|
|
240
240
|
}({}), Z = /* @__PURE__ */ function(e) {
|
|
241
241
|
return e.APPROVED = "APPROVED", e.CANCELLED = "CANCELLED", e.DECLINED = "DECLINED", e.UNKNOWN = "UNKNOWN", e;
|
|
242
242
|
}({}), Q = () => {
|
|
243
|
-
let e = new
|
|
243
|
+
let e = new le({
|
|
244
244
|
posId: t.posId,
|
|
245
245
|
posName: t.productName,
|
|
246
246
|
posVendorId: t.productVendorName,
|
|
247
247
|
posVersion: t.productVersion,
|
|
248
248
|
environment: o.value
|
|
249
249
|
}), n = async (t) => {
|
|
250
|
-
let n =
|
|
251
|
-
...
|
|
250
|
+
let n = te.create({
|
|
251
|
+
...f,
|
|
252
252
|
message: "Pairing with the terminal..."
|
|
253
253
|
}), r = await e.pairPinpad(t);
|
|
254
254
|
return n.update({
|
|
@@ -261,13 +261,13 @@ var z = {
|
|
|
261
261
|
let r = { Request: {
|
|
262
262
|
Merchant: "00",
|
|
263
263
|
Application: "00",
|
|
264
|
-
TxnRef:
|
|
264
|
+
TxnRef: l(),
|
|
265
265
|
TxnType: n,
|
|
266
266
|
CurrencyCode: q.AustralianDollar,
|
|
267
267
|
CutReceipt: t.CutReceipt,
|
|
268
268
|
AmtPurchase: t.AmtPurchase,
|
|
269
269
|
ReceiptAutoPrint: t.ReceiptAutoPrint
|
|
270
|
-
} }, i =
|
|
270
|
+
} }, i = p({
|
|
271
271
|
message: `${n === K.Purchase ? "Purchase" : "Refund"} of $${t.AmtPurchase / 100} in progress...`,
|
|
272
272
|
onCancel: () => {
|
|
273
273
|
i.progress("Trying to cancel transaction..."), e.sendKey(X.Cancel);
|
|
@@ -278,19 +278,27 @@ var z = {
|
|
|
278
278
|
return t?.response?.responseCode === Y.APPROVED || t?.response?.responseCode === Y.Approved ? (i.success("Transaction Approved!"), {
|
|
279
279
|
result: Z.APPROVED,
|
|
280
280
|
data: t.response,
|
|
281
|
-
tipAmount: t.response?.amtTip ?? null
|
|
281
|
+
tipAmount: t.response?.amtTip ?? null,
|
|
282
|
+
maskedCard: s(t.response?.pan),
|
|
283
|
+
cardScheme: t.response?.cardType?.trim() || null
|
|
282
284
|
}) : t?.response?.responseCode === Y.GENERAL_DECLINE ? (i.failed("Transaction Declined!"), {
|
|
283
285
|
result: Z.DECLINED,
|
|
284
286
|
data: t.response,
|
|
285
|
-
tipAmount: t.response?.amtTip ?? null
|
|
287
|
+
tipAmount: t.response?.amtTip ?? null,
|
|
288
|
+
maskedCard: s(t.response?.pan),
|
|
289
|
+
cardScheme: t.response?.cardType?.trim() || null
|
|
286
290
|
}) : t?.response?.responseCode === Y.CANCELLED ? (i.failed("Transaction Cancelled!"), {
|
|
287
291
|
result: Z.CANCELLED,
|
|
288
292
|
data: t.response,
|
|
289
|
-
tipAmount: t.response?.amtTip ?? null
|
|
293
|
+
tipAmount: t.response?.amtTip ?? null,
|
|
294
|
+
maskedCard: s(t.response?.pan),
|
|
295
|
+
cardScheme: t.response?.cardType?.trim() || null
|
|
290
296
|
}) : (i.failed("Transaction Failed!"), {
|
|
291
297
|
result: Z.UNKNOWN,
|
|
292
298
|
data: t.response,
|
|
293
|
-
tipAmount: t.response?.amtTip ?? null
|
|
299
|
+
tipAmount: t.response?.amtTip ?? null,
|
|
300
|
+
maskedCard: s(t.response?.pan),
|
|
301
|
+
cardScheme: t.response?.cardType?.trim() || null
|
|
294
302
|
});
|
|
295
303
|
} catch (e) {
|
|
296
304
|
throw i.failed("Transaction Failed!"), e;
|
|
@@ -315,7 +323,7 @@ var z = {
|
|
|
315
323
|
getTransactionBySessionId: e.getTransactionStatus,
|
|
316
324
|
getLastTransaction: e.getLastTransactionStatus
|
|
317
325
|
};
|
|
318
|
-
},
|
|
326
|
+
}, ue = { class: "" }, de = /* @__PURE__ */ y({
|
|
319
327
|
__name: "ReprintReceiptDialog",
|
|
320
328
|
props: {
|
|
321
329
|
modelValue: { type: Boolean },
|
|
@@ -323,37 +331,37 @@ var z = {
|
|
|
323
331
|
},
|
|
324
332
|
emits: ["update:modelValue"],
|
|
325
333
|
setup(e) {
|
|
326
|
-
let t = Q(), n =
|
|
334
|
+
let t = Q(), n = E(e, "modelValue"), r = x(""), i = async () => {
|
|
327
335
|
try {
|
|
328
|
-
|
|
336
|
+
k.show({ group: "reprintReceipt" });
|
|
329
337
|
let e = await t.reprintReceipt(r.value || void 0);
|
|
330
|
-
e.success ? (n.value = !1,
|
|
338
|
+
e.success ? (n.value = !1, A.create("Receipt printed successfully")) : A.create({
|
|
331
339
|
type: "negative",
|
|
332
340
|
message: e.message
|
|
333
341
|
});
|
|
334
342
|
} catch (e) {
|
|
335
343
|
let t = e instanceof Error ? e.message : "Failed to print receipts";
|
|
336
|
-
|
|
344
|
+
A.create({
|
|
337
345
|
type: "negative",
|
|
338
346
|
message: t
|
|
339
347
|
});
|
|
340
348
|
} finally {
|
|
341
|
-
|
|
349
|
+
k.hide("reprintReceipt");
|
|
342
350
|
}
|
|
343
351
|
};
|
|
344
352
|
return (e, t) => {
|
|
345
|
-
let a =
|
|
346
|
-
return
|
|
353
|
+
let a = C("close-popup");
|
|
354
|
+
return b(), m(T(ie), {
|
|
347
355
|
modelValue: n.value,
|
|
348
356
|
"onUpdate:modelValue": t[1] ||= (e) => n.value = e
|
|
349
357
|
}, {
|
|
350
|
-
default:
|
|
351
|
-
default:
|
|
352
|
-
|
|
353
|
-
default:
|
|
354
|
-
default:
|
|
358
|
+
default: D(() => [v(T(M), { class: "w-full" }, {
|
|
359
|
+
default: D(() => [
|
|
360
|
+
v(T(ae), { class: "bg-primary text-white" }, {
|
|
361
|
+
default: D(() => [v(T(oe), null, {
|
|
362
|
+
default: D(() => [S(e.$slots, "title", {}, () => [t[2] ||= _("Reprint Receipt", -1)])]),
|
|
355
363
|
_: 3
|
|
356
|
-
}),
|
|
364
|
+
}), O(v(T(P), {
|
|
357
365
|
class: "float-right cursor-pointer rounded p-2 transition-colors",
|
|
358
366
|
color: "gray",
|
|
359
367
|
name: "close",
|
|
@@ -361,8 +369,8 @@ var z = {
|
|
|
361
369
|
}, null, 512), [[a]])]),
|
|
362
370
|
_: 3
|
|
363
371
|
}),
|
|
364
|
-
|
|
365
|
-
default:
|
|
372
|
+
v(T(re), null, {
|
|
373
|
+
default: D(() => [g("div", ue, [t[3] ||= _(" Txn Number: ", -1), v(T(F), {
|
|
366
374
|
modelValue: r.value,
|
|
367
375
|
"onUpdate:modelValue": t[0] ||= (e) => r.value = e,
|
|
368
376
|
class: "q-mb-sm",
|
|
@@ -373,16 +381,16 @@ var z = {
|
|
|
373
381
|
}, null, 8, ["modelValue"])])]),
|
|
374
382
|
_: 1
|
|
375
383
|
}),
|
|
376
|
-
|
|
384
|
+
v(T(ne), {
|
|
377
385
|
class: "!p-4",
|
|
378
386
|
align: "right"
|
|
379
387
|
}, {
|
|
380
|
-
default:
|
|
388
|
+
default: D(() => [O(v(T(j), {
|
|
381
389
|
label: "Cancel",
|
|
382
390
|
"no-caps": "",
|
|
383
391
|
unelevated: "",
|
|
384
392
|
flat: ""
|
|
385
|
-
}, null, 512), [[a]]),
|
|
393
|
+
}, null, 512), [[a]]), v(T(j), {
|
|
386
394
|
label: "Re-print Receipt",
|
|
387
395
|
"no-caps": "",
|
|
388
396
|
unelevated: "",
|
|
@@ -398,7 +406,7 @@ var z = {
|
|
|
398
406
|
}, 8, ["modelValue"]);
|
|
399
407
|
};
|
|
400
408
|
}
|
|
401
|
-
}),
|
|
409
|
+
}), fe = { class: "" }, pe = { class: "text-center" }, $ = { class: "mb-6" }, me = { class: "mb-6 text-sm text-gray-500 dark:text-gray-300" }, he = { class: "!space-x-3" }, ge = { key: 1 }, _e = { class: "flex items-center justify-end gap-3" }, ve = /* @__PURE__ */ y({
|
|
402
410
|
__name: "PairLinkly",
|
|
403
411
|
emits: ["pairing-success"],
|
|
404
412
|
setup(t, { emit: o }) {
|
|
@@ -407,71 +415,71 @@ var z = {
|
|
|
407
415
|
"Set the PIN pad up to connect to the Linkly cloud. Each bank may have different configuration settings.",
|
|
408
416
|
"Once connected, the PIN pad will display a temporary 'pair code'",
|
|
409
417
|
"Enter the username, password, and PIN pad 'pair code' from the PIN pad in the form on next screen."
|
|
410
|
-
], c = (e) => [(t) => !!t || `${e} is required`, (t) => t.length <= 16 || `${e} must be less than 16 characters.`], l = o, u = Q(), d =
|
|
418
|
+
], c = (e) => [(t) => !!t || `${e} is required`, (t) => t.length <= 16 || `${e} must be less than 16 characters.`], l = o, u = Q(), d = se("linkly.pairConfig", {
|
|
411
419
|
isPaired: !1,
|
|
412
420
|
lastPairedDate: null
|
|
413
|
-
}), f =
|
|
421
|
+
}), f = x(!1), p = x({
|
|
414
422
|
username: "",
|
|
415
423
|
password: "",
|
|
416
424
|
pairCode: ""
|
|
417
|
-
}),
|
|
418
|
-
|
|
425
|
+
}), _ = x(!d.value.isPaired), y = () => {
|
|
426
|
+
_.value = !1;
|
|
419
427
|
}, S = async () => {
|
|
420
|
-
let e = await u.pairPinpad(
|
|
428
|
+
let e = await u.pairPinpad(p.value);
|
|
421
429
|
e.success && (d.value.isPaired = !0, d.value.lastPairedDate = /* @__PURE__ */ new Date(), l("pairing-success", e));
|
|
422
|
-
},
|
|
430
|
+
}, C = () => {
|
|
423
431
|
u.unpairPinpad(), d.value.isPaired = !1, d.value.lastPairedDate = null;
|
|
424
432
|
};
|
|
425
|
-
return ee(() => {}), (t, o) => (
|
|
433
|
+
return ee(() => {}), (t, o) => (b(), h("div", fe, [T(d).isPaired ? (b(), m(T(M), {
|
|
426
434
|
key: "paired",
|
|
427
435
|
class: "flex items-center justify-center rounded-lg p-8",
|
|
428
436
|
flat: "",
|
|
429
437
|
bordered: ""
|
|
430
438
|
}, {
|
|
431
|
-
default:
|
|
432
|
-
|
|
433
|
-
name:
|
|
439
|
+
default: D(() => [g("div", pe, [
|
|
440
|
+
g("div", $, [v(T(P), {
|
|
441
|
+
name: T(i),
|
|
434
442
|
size: "4rem",
|
|
435
443
|
class: "text-green-500"
|
|
436
444
|
}, null, 8, ["name"])]),
|
|
437
|
-
o[6] ||=
|
|
438
|
-
|
|
439
|
-
|
|
445
|
+
o[6] ||= g("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1),
|
|
446
|
+
g("p", me, " Last paired: " + w(new Date(T(d).lastPairedDate).toLocaleString()), 1),
|
|
447
|
+
g("div", he, [v(T(j), {
|
|
440
448
|
color: "green",
|
|
441
449
|
"no-caps": "",
|
|
442
450
|
outline: "",
|
|
443
451
|
unelevated: "",
|
|
444
452
|
label: "Reprint Receipt",
|
|
445
|
-
"icon-left":
|
|
453
|
+
"icon-left": T(n),
|
|
446
454
|
onClick: o[0] ||= (e) => f.value = !0
|
|
447
|
-
}, null, 8, ["icon-left"]),
|
|
455
|
+
}, null, 8, ["icon-left"]), v(T(j), {
|
|
448
456
|
color: "primary",
|
|
449
457
|
unelevated: "",
|
|
450
458
|
"no-caps": "",
|
|
451
|
-
"icon-left":
|
|
459
|
+
"icon-left": T(r),
|
|
452
460
|
label: "Re-pair Terminal",
|
|
453
|
-
onClick:
|
|
461
|
+
onClick: C
|
|
454
462
|
}, null, 8, ["icon-left"])])
|
|
455
463
|
])]),
|
|
456
464
|
_: 1
|
|
457
|
-
})) : (
|
|
465
|
+
})) : (b(), h("section", ge, [_.value ? (b(), m(a, {
|
|
458
466
|
key: 0,
|
|
459
|
-
onNext:
|
|
467
|
+
onNext: y,
|
|
460
468
|
steps: s
|
|
461
|
-
})) : (
|
|
469
|
+
})) : (b(), m(T(M), {
|
|
462
470
|
key: 1,
|
|
463
471
|
flat: "",
|
|
464
472
|
bordered: "",
|
|
465
473
|
class: "w-full rounded-md p-6"
|
|
466
474
|
}, {
|
|
467
|
-
default:
|
|
475
|
+
default: D(() => [o[7] ||= g("div", { class: "text-lg font-semibold" }, "Pairing configuration", -1), v(T(N), {
|
|
468
476
|
onSubmit: S,
|
|
469
477
|
class: "mt-6 space-y-4"
|
|
470
478
|
}, {
|
|
471
|
-
default:
|
|
472
|
-
|
|
473
|
-
modelValue:
|
|
474
|
-
"onUpdate:modelValue": o[1] ||= (e) =>
|
|
479
|
+
default: D(() => [
|
|
480
|
+
v(T(F), {
|
|
481
|
+
modelValue: p.value.username,
|
|
482
|
+
"onUpdate:modelValue": o[1] ||= (e) => p.value.username = e,
|
|
475
483
|
rules: c("Username"),
|
|
476
484
|
label: "Username",
|
|
477
485
|
hint: "Cloud EFT Client Username",
|
|
@@ -480,9 +488,9 @@ var z = {
|
|
|
480
488
|
"no-error-icon": "",
|
|
481
489
|
dense: ""
|
|
482
490
|
}, null, 8, ["modelValue", "rules"]),
|
|
483
|
-
|
|
484
|
-
modelValue:
|
|
485
|
-
"onUpdate:modelValue": o[2] ||= (e) =>
|
|
491
|
+
v(T(F), {
|
|
492
|
+
modelValue: p.value.password,
|
|
493
|
+
"onUpdate:modelValue": o[2] ||= (e) => p.value.password = e,
|
|
486
494
|
rules: c("Password"),
|
|
487
495
|
label: "Password",
|
|
488
496
|
"no-error-icon": "",
|
|
@@ -491,9 +499,9 @@ var z = {
|
|
|
491
499
|
hint: "Enter Cloud EFT Client Password",
|
|
492
500
|
dense: ""
|
|
493
501
|
}, null, 8, ["modelValue", "rules"]),
|
|
494
|
-
|
|
495
|
-
modelValue:
|
|
496
|
-
"onUpdate:modelValue": o[3] ||= (e) =>
|
|
502
|
+
v(T(F), {
|
|
503
|
+
modelValue: p.value.pairCode,
|
|
504
|
+
"onUpdate:modelValue": o[3] ||= (e) => p.value.pairCode = e,
|
|
497
505
|
rules: c("Pairing Code"),
|
|
498
506
|
label: "Pairing Code",
|
|
499
507
|
type: "text",
|
|
@@ -502,29 +510,29 @@ var z = {
|
|
|
502
510
|
hint: "Enter Pair code from terminal screen",
|
|
503
511
|
dense: ""
|
|
504
512
|
}, null, 8, ["modelValue", "rules"]),
|
|
505
|
-
|
|
513
|
+
g("div", _e, [v(T(j), {
|
|
506
514
|
flat: "",
|
|
507
515
|
"no-caps": "",
|
|
508
516
|
label: "Back",
|
|
509
|
-
"icon-left":
|
|
510
|
-
onClick: o[4] ||= (e) =>
|
|
511
|
-
}, null, 8, ["icon-left"]),
|
|
517
|
+
"icon-left": T(n),
|
|
518
|
+
onClick: o[4] ||= (e) => _.value = !0
|
|
519
|
+
}, null, 8, ["icon-left"]), v(T(j), {
|
|
512
520
|
type: "submit",
|
|
513
521
|
color: "primary",
|
|
514
522
|
unelevated: "",
|
|
515
523
|
"no-caps": "",
|
|
516
|
-
"icon-right":
|
|
524
|
+
"icon-right": T(e),
|
|
517
525
|
label: "Pair Device"
|
|
518
526
|
}, null, 8, ["icon-right"])])
|
|
519
527
|
]),
|
|
520
528
|
_: 1
|
|
521
529
|
})]),
|
|
522
530
|
_: 1
|
|
523
|
-
}))])),
|
|
531
|
+
}))])), v(de, {
|
|
524
532
|
modelValue: f.value,
|
|
525
533
|
"onUpdate:modelValue": o[5] ||= (e) => f.value = e
|
|
526
534
|
}, null, 8, ["modelValue"])]));
|
|
527
535
|
}
|
|
528
536
|
});
|
|
529
537
|
//#endregion
|
|
530
|
-
export { J as a, K as c, X as i, Q as n, Y as o, q as r, Z as s,
|
|
538
|
+
export { J as a, K as c, X as i, Q as n, Y as o, q as r, Z as s, ve as t };
|
package/dist/linkly.d.ts
CHANGED
|
@@ -424,6 +424,8 @@ export declare const useLinkly: () => {
|
|
|
424
424
|
};
|
|
425
425
|
};
|
|
426
426
|
tipAmount: number;
|
|
427
|
+
maskedCard: string | null;
|
|
428
|
+
cardScheme: string | null;
|
|
427
429
|
}>;
|
|
428
430
|
initiateRefund: (data: TransactionPayload) => Promise<{
|
|
429
431
|
result: TransactionOutcome;
|
|
@@ -471,6 +473,8 @@ export declare const useLinkly: () => {
|
|
|
471
473
|
};
|
|
472
474
|
};
|
|
473
475
|
tipAmount: number;
|
|
476
|
+
maskedCard: string | null;
|
|
477
|
+
cardScheme: string | null;
|
|
474
478
|
}>;
|
|
475
479
|
reprintReceipt: (txnRef?: string) => Promise< ReceiptReprintReturn>;
|
|
476
480
|
getTransactionBySessionId: (transactionId: string) => Promise< LinklyTransactionResponse>;
|
package/dist/linkly.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./linkly-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./linkly-D3mav3HW.js";
|
|
2
2
|
export { a as CurrencyCodes, n as LinklyKeyType, s as PairLinkly, e as ReceiptAutoPrint, i as ResponseCodes, o as TransactionOutcome, t as TransactionTypes, r as useLinkly };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, h as t, i as n, o as r, r as i, t as a, u as o } from "./PairInstructions-BxzivULm.js";
|
|
2
|
-
import { t as s } from "./utils-
|
|
2
|
+
import { t as s } from "./utils-o5X3364V.js";
|
|
3
3
|
import { t as c } from "./utils-BPFf60Ai.js";
|
|
4
4
|
import { createBlock as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, openBlock as h, ref as g, toDisplayString as _, unref as v, withCtx as y, withModifiers as b } from "vue";
|
|
5
5
|
import { Dialog as x, QBtn as S, QCard as C, QIcon as w, QInput as T } from "quasar";
|
|
@@ -156,7 +156,9 @@ var A = /* @__PURE__ */ function(e) {
|
|
|
156
156
|
R(a, e.transactionOutcome), r({
|
|
157
157
|
...e,
|
|
158
158
|
smartPayCustomerReceipt: e.responseData?.data?.Receipt,
|
|
159
|
-
tipAmount: z(e.responseData?.data?.AmountTip)
|
|
159
|
+
tipAmount: z(e.responseData?.data?.AmountTip),
|
|
160
|
+
maskedCard: e.responseData?.data?.CardPan || null,
|
|
161
|
+
cardScheme: e.responseData?.data?.CardType || null
|
|
160
162
|
}), setTimeout(a.hide, 3e3);
|
|
161
163
|
}).catch((e) => {
|
|
162
164
|
a.update({
|
package/dist/smartpay.d.ts
CHANGED
|
@@ -57,6 +57,16 @@ declare interface SmartConnectPayRef extends PollingResult {
|
|
|
57
57
|
* The tip amount in cents, flattened to the top level for easy access.
|
|
58
58
|
*/
|
|
59
59
|
tipAmount: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* Masked card number (PAN), flattened to the top level for easy access, or
|
|
62
|
+
* `null` when SmartPay didn't report one.
|
|
63
|
+
*/
|
|
64
|
+
maskedCard: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Card scheme / company (e.g. "Visa", "Mastercard"), flattened to the top
|
|
67
|
+
* level for easy access, or `null` when SmartPay didn't report one.
|
|
68
|
+
*/
|
|
69
|
+
cardScheme: string | null;
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
export declare class SmartPay {
|
package/dist/smartpay.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./smartpay-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./smartpay-Be3u1f3L.js";
|
|
2
2
|
export { n as DEV_SMARTPAY_API_URL, e as PROD_SMARTPAY_API_URL, c as PairSmartPay, a as ResultType, o as SmartPay, s as TransactionOutcome, t as TransactionResult, r as TransactionStatus, l as TransactionTypes, i as useSmartPay };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { a as e, h as t, i as n, o as r, r as i, t as a } from "./PairInstructions-BxzivULm.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { createBlock as
|
|
5
|
-
import { Dialog as
|
|
2
|
+
import { a as o, t as s } from "./utils-o5X3364V.js";
|
|
3
|
+
import { n as c, r as l, t as u } from "./core-BMUVlh-t.js";
|
|
4
|
+
import { createBlock as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, onMounted as _, openBlock as v, ref as y, renderSlot as b, resolveDirective as x, toDisplayString as S, unref as C, useModel as w, withCtx as T, withDirectives as E } from "vue";
|
|
5
|
+
import { Dialog as D, Loading as O, Notify as k, QBtn as A, QCard as j, QCardActions as M, QCardSection as N, QDialog as P, QForm as F, QIcon as I, QInput as L, QSelect as R, QToolbar as ee, QToolbarTitle as z } from "quasar";
|
|
6
6
|
import { useLocalStorage as B } from "@vueuse/core";
|
|
7
7
|
import { validate as V } from "uuid";
|
|
8
8
|
import H from "dayjs";
|
|
9
|
-
import U, { HttpStatusCode as W, isAxiosError as
|
|
9
|
+
import U, { HttpStatusCode as W, isAxiosError as G } from "axios";
|
|
10
10
|
//#region src/library/till-payment/tillPayment.enums.ts
|
|
11
|
-
var
|
|
11
|
+
var K = /* @__PURE__ */ function(e) {
|
|
12
12
|
return e.SETTLEMENT = "SETTLEMENT", e.PRE_SETTLEMENT = "PRE_SETTLEMENT", e.LAST_SETTLEMENT = "LAST_SETTLEMENT", e;
|
|
13
|
-
}({}),
|
|
13
|
+
}({}), q = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e.REPRINT_RECEIPT = "REPRINT_RECEIPT", e.PAYMENT = "PAYMENT", e.REFUND = "REFUND", e.REVERSAL = "REVERSAL", e.PREAUTH = "PREAUTH", e.PREAUTH_CANCEL = "PREAUTH_CANCEL", e.PREAUTH_CAPTURE = "PREAUTH_CAPTURE", e;
|
|
15
|
-
}({}),
|
|
15
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
16
16
|
return e.Accepted = "accepted", e.Declined = "declined", e.Cancelled = "cancelled", e.Timeout = "timeout", e.Failed = "failed", e;
|
|
17
|
-
}({}),
|
|
18
|
-
if (console.error(e),
|
|
17
|
+
}({}), Y = (e) => {
|
|
18
|
+
if (console.error(e), G(e)) {
|
|
19
19
|
let t = e.response?.data, n = t?.statusCode, r = e.code === "ERR_NETWORK";
|
|
20
20
|
return {
|
|
21
21
|
error: !0,
|
|
@@ -29,7 +29,7 @@ var te = /* @__PURE__ */ function(e) {
|
|
|
29
29
|
message: e instanceof Error ? e.message : "something went wrong!",
|
|
30
30
|
statusCode: W.BadRequest
|
|
31
31
|
};
|
|
32
|
-
},
|
|
32
|
+
}, X = (e) => (e / 100).toFixed(2), Z = (e, t) => {
|
|
33
33
|
try {
|
|
34
34
|
if (!t) return null;
|
|
35
35
|
let n = JSON.parse(t), r = n.maskedMerchantId || `...${n.merchantId.slice(-4)}`, i = n.maskedTerminalId || n.terminalId, a = n.authMessage?.split("\\n") || [], o = a[0] || "", s = a[1] || "", c = (e, t) => `${e.padEnd(14)}${" AUD".padEnd(8)}${`$${t}`.padStart(10)}`;
|
|
@@ -44,14 +44,14 @@ var te = /* @__PURE__ */ function(e) {
|
|
|
44
44
|
Card: ${n.maskedPan}
|
|
45
45
|
Method: ${n.cardEntryMethod}${n.applicationIdentifier ? `\n AID: ${n.applicationIdentifier}` : ""}\n`,
|
|
46
46
|
"",
|
|
47
|
-
c(n.transactionType,
|
|
47
|
+
c(n.transactionType, X(n.amount.subtotal || n.paymentAmount - (n.amount.surcharge || 0) - (n.amount.tip || 0))),
|
|
48
48
|
[
|
|
49
|
-
n.amount.surcharge > 0 ? c("Surcharge",
|
|
50
|
-
n.amount.tip > 0 ? c("Tip",
|
|
51
|
-
n.amount.tax > 0 ? c("Tax",
|
|
49
|
+
n.amount.surcharge > 0 ? c("Surcharge", X(n.amount.surcharge)) : null,
|
|
50
|
+
n.amount.tip > 0 ? c("Tip", X(n.amount.tip)) : null,
|
|
51
|
+
n.amount.tax > 0 ? c("Tax", X(n.amount.tax)) : null
|
|
52
52
|
].filter(Boolean).join("\n"),
|
|
53
53
|
"-".repeat(32),
|
|
54
|
-
c("Total",
|
|
54
|
+
c("Total", X(n.paymentAmount)),
|
|
55
55
|
`
|
|
56
56
|
Auth Code: ${n.authCode}
|
|
57
57
|
Response: ${o} ${s}
|
|
@@ -65,7 +65,7 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
65
65
|
} catch (e) {
|
|
66
66
|
return console.error("Receipt generation error:", e), null;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, Q = class e {
|
|
69
69
|
api;
|
|
70
70
|
config;
|
|
71
71
|
static URLS = {
|
|
@@ -113,14 +113,14 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
113
113
|
try {
|
|
114
114
|
return (await this.api.get("/terminals")).data.terminals;
|
|
115
115
|
} catch (e) {
|
|
116
|
-
return
|
|
116
|
+
return Y(e);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
async getSpecificTerminal(e) {
|
|
120
120
|
try {
|
|
121
121
|
return (await this.api.get(`/terminals/${e}`)).data.terminal;
|
|
122
122
|
} catch (e) {
|
|
123
|
-
return
|
|
123
|
+
return Y(e);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
async pairTerminal(e) {
|
|
@@ -132,7 +132,7 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
132
132
|
statusCode: 0
|
|
133
133
|
};
|
|
134
134
|
} catch (e) {
|
|
135
|
-
return
|
|
135
|
+
return Y(e);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
unpair() {
|
|
@@ -143,11 +143,11 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
143
143
|
let t = await this.api.get(`/intent/${e}`);
|
|
144
144
|
return {
|
|
145
145
|
...t.data,
|
|
146
|
-
customerReceipt:
|
|
147
|
-
merchantReceipt:
|
|
146
|
+
customerReceipt: Z("CUSTOMER COPY", t.data.transactionDetails?.rawReceipt),
|
|
147
|
+
merchantReceipt: Z("MERCHANT COPY", t.data.transactionDetails?.rawReceipt)
|
|
148
148
|
};
|
|
149
149
|
} catch (e) {
|
|
150
|
-
return
|
|
150
|
+
return Y(e);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
async createPaymentIntent(e) {
|
|
@@ -165,7 +165,7 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
165
165
|
if (!e) return;
|
|
166
166
|
if ((await this.api.post(`/intent/${e}/cancel`, { tid: this._getTid() })).status === 204) return !0;
|
|
167
167
|
} catch (e) {
|
|
168
|
-
return
|
|
168
|
+
return Y(e);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
async requestTerminalToProcessIntent(e, t) {
|
|
@@ -178,14 +178,14 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
178
178
|
async processTransaction(e, t) {
|
|
179
179
|
try {
|
|
180
180
|
if (this._setRunningTxnId(t), !await this.requestTerminalToProcessIntent(e, t)) return this._deleteRunningTxnId(), {
|
|
181
|
-
transactionOutcome:
|
|
181
|
+
transactionOutcome: J.Failed,
|
|
182
182
|
message: "Failed to send payment request to terminal.",
|
|
183
183
|
data: null
|
|
184
184
|
};
|
|
185
185
|
this._setLastTransactionId(t);
|
|
186
186
|
let n, r = Date.now(), i = /* @__PURE__ */ new Set(["PENDING", "PROCESSING"]), a;
|
|
187
187
|
for (; Date.now() - r < 18e4 && (!n || i.has(n.status));) {
|
|
188
|
-
await
|
|
188
|
+
await s(2e3);
|
|
189
189
|
let e = await this.getIntentById(t);
|
|
190
190
|
if ("error" in e) {
|
|
191
191
|
if (e.code === "ERR_NETWORK") continue;
|
|
@@ -193,12 +193,12 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
193
193
|
}
|
|
194
194
|
n = e;
|
|
195
195
|
}
|
|
196
|
-
return a = !n || i.has(n.status) ?
|
|
196
|
+
return a = !n || i.has(n.status) ? J.Timeout : n.status === "COMPLETED" ? n.transactionDetails?.status === "SUCCESS" ? J.Accepted : n.transactionDetails?.status === "CANCELLED" ? J.Cancelled : n.transactionDetails?.status === "DECLINED" ? J.Declined : J.Failed : J.Failed, this._deleteRunningTxnId(), {
|
|
197
197
|
transactionOutcome: a,
|
|
198
198
|
data: n
|
|
199
199
|
};
|
|
200
200
|
} catch (e) {
|
|
201
|
-
return this._deleteRunningTxnId(),
|
|
201
|
+
return this._deleteRunningTxnId(), Y(e);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async initiatePurchase(e) {
|
|
@@ -206,7 +206,7 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
206
206
|
let t = await this.createPaymentIntent(e);
|
|
207
207
|
return this.processTransaction(this._getTid(), t.intentId);
|
|
208
208
|
} catch (e) {
|
|
209
|
-
return
|
|
209
|
+
return Y(e);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
async initiateRefund(e) {
|
|
@@ -214,14 +214,14 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
214
214
|
let t = await this.createRefundIntent(e);
|
|
215
215
|
return this.processTransaction(this._getTid(), t.intentId);
|
|
216
216
|
} catch (e) {
|
|
217
|
-
return
|
|
217
|
+
return Y(e);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
async reprintReceipt(e) {
|
|
221
221
|
try {
|
|
222
222
|
let t = await this.createNftIntent({
|
|
223
223
|
parentIntentId: e,
|
|
224
|
-
type:
|
|
224
|
+
type: q.REPRINT_RECEIPT
|
|
225
225
|
});
|
|
226
226
|
return await this.requestTerminalToProcessIntent(this._getTid(), t.intentId) ? {
|
|
227
227
|
error: !1,
|
|
@@ -233,7 +233,7 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
233
233
|
statusCode: 0
|
|
234
234
|
};
|
|
235
235
|
} catch (e) {
|
|
236
|
-
return
|
|
236
|
+
return Y(e);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
async getLastTransaction() {
|
|
@@ -247,37 +247,39 @@ ${H(n.dateTime).format("DD MMM YYYY [at] hh:mm A")}
|
|
|
247
247
|
};
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region src/library/till-payment/tillPayment.mapper.ts
|
|
250
|
-
function
|
|
250
|
+
function te(e) {
|
|
251
251
|
switch (e) {
|
|
252
|
-
case
|
|
253
|
-
case
|
|
254
|
-
case
|
|
255
|
-
case
|
|
256
|
-
default: return
|
|
252
|
+
case J.Accepted: return c.Approved;
|
|
253
|
+
case J.Declined: return c.Declined;
|
|
254
|
+
case J.Cancelled: return c.Cancelled;
|
|
255
|
+
case J.Timeout: return c.Timeout;
|
|
256
|
+
default: return c.Failed;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
function ne(e) {
|
|
260
|
-
if ("error" in e) return
|
|
261
|
-
status:
|
|
260
|
+
if ("error" in e) return l({
|
|
261
|
+
status: c.Failed,
|
|
262
262
|
message: e.message,
|
|
263
263
|
raw: e
|
|
264
264
|
});
|
|
265
|
-
let t =
|
|
266
|
-
return e.data?.merchantReceipt && (
|
|
265
|
+
let t = te(e.transactionOutcome), n = e.data?.transactionDetails, r = n?.paymentMethod?.card, i = o(r?.last4Digit), a = {};
|
|
266
|
+
return e.data?.merchantReceipt && (a.merchant = e.data.merchantReceipt), e.data?.customerReceipt && (a.customer = e.data.customerReceipt), l({
|
|
267
267
|
status: t,
|
|
268
268
|
transactionId: e.data?.intentId ?? null,
|
|
269
269
|
amount: n?.paymentAmount ?? null,
|
|
270
270
|
tipAmount: n?.amount.tip || null,
|
|
271
271
|
surchargeAmount: n ? n.amount.surcharge : null,
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
maskedCard: i,
|
|
273
|
+
cardScheme: r?.scheme ?? null,
|
|
274
|
+
receipts: a,
|
|
275
|
+
message: e.message ?? (t === c.Approved ? "Transaction Accepted!" : `Transaction ${e.transactionOutcome}!`),
|
|
274
276
|
raw: e.data ?? null
|
|
275
277
|
});
|
|
276
278
|
}
|
|
277
279
|
//#endregion
|
|
278
280
|
//#region src/library/till-payment/useTillPayment.ts
|
|
279
|
-
var re = () => !!localStorage.getItem("till.tid"),
|
|
280
|
-
let e = new
|
|
281
|
+
var re = () => !!localStorage.getItem("till.tid"), $ = () => {
|
|
282
|
+
let e = new Q({
|
|
281
283
|
apiKey: t.tillPaymentApiKey,
|
|
282
284
|
merchantId: t.tillPaymentMerchantId,
|
|
283
285
|
environment: "SANDBOX"
|
|
@@ -295,7 +297,7 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
295
297
|
}, r = () => {
|
|
296
298
|
e.unpair();
|
|
297
299
|
}, i = async (t, n, r) => {
|
|
298
|
-
let i = r?.tipAmount, a =
|
|
300
|
+
let i = r?.tipAmount, a = u({
|
|
299
301
|
message: `${t} of $${n / 100}${i === void 0 ? "" : ` (+ $${i / 100} tip)`} in progress...`,
|
|
300
302
|
onCancel: () => {
|
|
301
303
|
a.progress("Trying to cancel transaction..."), e.cancelIntent();
|
|
@@ -314,7 +316,7 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
314
316
|
refund: (e) => i("Refund", e),
|
|
315
317
|
reprintReceipt: async (t) => {
|
|
316
318
|
try {
|
|
317
|
-
return
|
|
319
|
+
return O.show(), await e.reprintReceipt(t);
|
|
318
320
|
} catch (e) {
|
|
319
321
|
return console.error(e), {
|
|
320
322
|
error: !0,
|
|
@@ -322,12 +324,12 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
322
324
|
statusCode: 400
|
|
323
325
|
};
|
|
324
326
|
} finally {
|
|
325
|
-
|
|
327
|
+
O.hide();
|
|
326
328
|
}
|
|
327
329
|
},
|
|
328
330
|
raw: e
|
|
329
331
|
};
|
|
330
|
-
}, ie = { class: "" }, ae = /* @__PURE__ */
|
|
332
|
+
}, ie = { class: "" }, ae = /* @__PURE__ */ g({
|
|
331
333
|
__name: "ReprintReceiptDialog",
|
|
332
334
|
props: {
|
|
333
335
|
modelValue: { type: Boolean },
|
|
@@ -335,38 +337,38 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
335
337
|
},
|
|
336
338
|
emits: ["update:modelValue"],
|
|
337
339
|
setup(e) {
|
|
338
|
-
let t =
|
|
340
|
+
let t = $(), n = w(e, "modelValue"), r = y(""), i = async () => {
|
|
339
341
|
try {
|
|
340
|
-
|
|
342
|
+
O.show({ group: "reprintReceipt" });
|
|
341
343
|
let e = await t.reprintReceipt(r.value);
|
|
342
|
-
e.error ?
|
|
344
|
+
e.error ? k.create({
|
|
343
345
|
type: "negative",
|
|
344
346
|
message: e.message
|
|
345
|
-
}) : (n.value = !1,
|
|
347
|
+
}) : (n.value = !1, k.create("Receipt printed successfully"));
|
|
346
348
|
} catch (e) {
|
|
347
349
|
let t = e instanceof Error ? e.message : "Failed to print receipts";
|
|
348
|
-
|
|
350
|
+
k.create({
|
|
349
351
|
type: "negative",
|
|
350
352
|
message: t
|
|
351
353
|
});
|
|
352
354
|
} finally {
|
|
353
|
-
|
|
355
|
+
O.hide("reprintReceipt");
|
|
354
356
|
}
|
|
355
357
|
};
|
|
356
358
|
return (e, t) => {
|
|
357
|
-
let a =
|
|
358
|
-
return
|
|
359
|
+
let a = x("close-popup");
|
|
360
|
+
return v(), d(C(P), {
|
|
359
361
|
modelValue: n.value,
|
|
360
362
|
"onUpdate:modelValue": t[1] ||= (e) => n.value = e
|
|
361
363
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
default:
|
|
364
|
-
default:
|
|
365
|
-
|
|
366
|
-
default:
|
|
367
|
-
default:
|
|
364
|
+
default: T(() => [h(C(j), { class: "w-full" }, {
|
|
365
|
+
default: T(() => [h(C(F), { onSubmit: i }, {
|
|
366
|
+
default: T(() => [
|
|
367
|
+
h(C(ee), { class: "bg-primary text-white" }, {
|
|
368
|
+
default: T(() => [h(C(z), null, {
|
|
369
|
+
default: T(() => [b(e.$slots, "title", {}, () => [t[2] ||= m("Reprint Receipt", -1)])]),
|
|
368
370
|
_: 3
|
|
369
|
-
}),
|
|
371
|
+
}), E(h(C(I), {
|
|
370
372
|
class: "float-right cursor-pointer rounded p-2 transition-colors",
|
|
371
373
|
color: "gray",
|
|
372
374
|
name: "close",
|
|
@@ -374,11 +376,11 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
374
376
|
}, null, 512), [[a]])]),
|
|
375
377
|
_: 3
|
|
376
378
|
}),
|
|
377
|
-
|
|
378
|
-
default:
|
|
379
|
+
h(C(N), null, {
|
|
380
|
+
default: T(() => [p("div", ie, [t[3] ||= m(" Txn Number: ", -1), h(C(L), {
|
|
379
381
|
modelValue: r.value,
|
|
380
382
|
"onUpdate:modelValue": t[0] ||= (e) => r.value = e,
|
|
381
|
-
rules: [(e) => !!e || "Transaction Id is required", (e) =>
|
|
383
|
+
rules: [(e) => !!e || "Transaction Id is required", (e) => C(V)(e) || "Invalid Transaction Id"],
|
|
382
384
|
class: "q-mb-sm",
|
|
383
385
|
type: "text",
|
|
384
386
|
outlined: "",
|
|
@@ -388,16 +390,16 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
388
390
|
}, null, 8, ["modelValue", "rules"])])]),
|
|
389
391
|
_: 1
|
|
390
392
|
}),
|
|
391
|
-
|
|
393
|
+
h(C(M), {
|
|
392
394
|
class: "!p-4",
|
|
393
395
|
align: "right"
|
|
394
396
|
}, {
|
|
395
|
-
default:
|
|
397
|
+
default: T(() => [E(h(C(A), {
|
|
396
398
|
label: "Cancel",
|
|
397
399
|
"no-caps": "",
|
|
398
400
|
unelevated: "",
|
|
399
401
|
flat: ""
|
|
400
|
-
}, null, 512), [[a]]),
|
|
402
|
+
}, null, 512), [[a]]), h(C(A), {
|
|
401
403
|
label: "Re-print Receipt",
|
|
402
404
|
"no-caps": "",
|
|
403
405
|
unelevated: "",
|
|
@@ -415,102 +417,102 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
415
417
|
}, 8, ["modelValue"]);
|
|
416
418
|
};
|
|
417
419
|
}
|
|
418
|
-
}), oe = { class: "text-center" },
|
|
420
|
+
}), oe = { class: "text-center" }, se = { class: "mb-6" }, ce = { class: "!mb-2 text-sm text-gray-500 dark:text-gray-300" }, le = { class: "mb-6 text-sm text-gray-500 dark:text-gray-300" }, ue = { class: "!space-x-3" }, de = { key: 1 }, fe = { class: "flex items-center justify-end gap-3" }, pe = /* @__PURE__ */ g({
|
|
419
421
|
__name: "PairTillPayment",
|
|
420
422
|
setup(t) {
|
|
421
423
|
let o = [
|
|
422
424
|
"Plug in the PIN pad and connect it to the internet via cable or Wi-Fi, depending on the EFTPOS hardware.",
|
|
423
425
|
"Once connected, the PIN pad will display as online.",
|
|
424
426
|
"Select the terminal on the next screen and click 'Pair Device'."
|
|
425
|
-
], { raw: s, pair: c, unpair: l } =
|
|
427
|
+
], { raw: s, pair: c, unpair: l } = $(), u = B("till.pairConfig", {
|
|
426
428
|
isPaired: !1,
|
|
427
429
|
lastPairedDate: "",
|
|
428
430
|
terminalId: ""
|
|
429
|
-
}),
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
},
|
|
431
|
+
}), g = y([]), b = y(null), x = y(!u.value.isPaired), w = y(!1), E = () => {
|
|
432
|
+
x.value = !1;
|
|
433
|
+
}, M = () => {
|
|
434
|
+
u.value.isPaired = !1, l();
|
|
435
|
+
}, P = async () => {
|
|
434
436
|
try {
|
|
435
|
-
|
|
437
|
+
O.show();
|
|
436
438
|
let e = await c({ tid: b.value });
|
|
437
439
|
if (!e.success) {
|
|
438
|
-
|
|
440
|
+
D.create({
|
|
439
441
|
title: "Pairing Failed!",
|
|
440
442
|
message: e.message ?? "Failed To pair terminal."
|
|
441
443
|
});
|
|
442
444
|
return;
|
|
443
445
|
}
|
|
444
|
-
|
|
446
|
+
u.value.isPaired = !0, u.value.lastPairedDate = /* @__PURE__ */ new Date(), u.value.terminalId = b.value;
|
|
445
447
|
} catch (e) {
|
|
446
|
-
|
|
448
|
+
D.create({
|
|
447
449
|
title: "Pairing Failed!",
|
|
448
450
|
message: e instanceof Error ? e.message : "Failed To pair terminal."
|
|
449
451
|
});
|
|
450
452
|
} finally {
|
|
451
|
-
|
|
453
|
+
O.hide();
|
|
452
454
|
}
|
|
453
|
-
},
|
|
455
|
+
}, L = async () => {
|
|
454
456
|
let e = await s.getTerminals();
|
|
455
457
|
if ("error" in e) {
|
|
456
|
-
|
|
458
|
+
k.create({
|
|
457
459
|
type: "negative",
|
|
458
460
|
message: "failed to fetch terminals"
|
|
459
461
|
});
|
|
460
462
|
return;
|
|
461
463
|
}
|
|
462
|
-
|
|
464
|
+
g.value = e;
|
|
463
465
|
};
|
|
464
|
-
return
|
|
465
|
-
await
|
|
466
|
-
}), (t, s) => (
|
|
466
|
+
return _(async () => {
|
|
467
|
+
await L();
|
|
468
|
+
}), (t, s) => (v(), f("div", null, [C(u).isPaired ? (v(), d(C(j), {
|
|
467
469
|
key: "paired",
|
|
468
470
|
class: "flex items-center justify-center rounded-lg p-8",
|
|
469
471
|
flat: "",
|
|
470
472
|
bordered: ""
|
|
471
473
|
}, {
|
|
472
|
-
default:
|
|
473
|
-
|
|
474
|
-
name:
|
|
474
|
+
default: T(() => [p("div", oe, [
|
|
475
|
+
p("div", se, [h(C(I), {
|
|
476
|
+
name: C(i),
|
|
475
477
|
size: "4rem",
|
|
476
478
|
class: "text-green-500"
|
|
477
479
|
}, null, 8, ["name"])]),
|
|
478
|
-
s[6] ||=
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
s[6] ||= p("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1),
|
|
481
|
+
p("p", ce, [s[4] ||= m(" Terminal ID: ", -1), p("b", null, S(C(u).terminalId), 1)]),
|
|
482
|
+
p("p", le, [s[5] ||= m(" Last paired: ", -1), p("b", null, S(new Date(C(u).lastPairedDate).toLocaleString()), 1)]),
|
|
483
|
+
p("div", ue, [h(C(A), {
|
|
482
484
|
color: "green",
|
|
483
485
|
"no-caps": "",
|
|
484
486
|
outline: "",
|
|
485
487
|
unelevated: "",
|
|
486
488
|
label: "Reprint Receipt",
|
|
487
|
-
"icon-left":
|
|
488
|
-
onClick: s[0] ||= (e) =>
|
|
489
|
-
}, null, 8, ["icon-left"]),
|
|
489
|
+
"icon-left": C(n),
|
|
490
|
+
onClick: s[0] ||= (e) => w.value = !0
|
|
491
|
+
}, null, 8, ["icon-left"]), h(C(A), {
|
|
490
492
|
color: "primary",
|
|
491
493
|
unelevated: "",
|
|
492
494
|
"no-caps": "",
|
|
493
|
-
"icon-left":
|
|
495
|
+
"icon-left": C(r),
|
|
494
496
|
label: "Re-pair Terminal",
|
|
495
|
-
onClick:
|
|
497
|
+
onClick: M
|
|
496
498
|
}, null, 8, ["icon-left"])])
|
|
497
|
-
]),
|
|
498
|
-
modelValue:
|
|
499
|
-
"onUpdate:modelValue": s[1] ||= (e) =>
|
|
499
|
+
]), h(ae, {
|
|
500
|
+
modelValue: w.value,
|
|
501
|
+
"onUpdate:modelValue": s[1] ||= (e) => w.value = e
|
|
500
502
|
}, null, 8, ["modelValue"])]),
|
|
501
503
|
_: 1
|
|
502
|
-
})) : (
|
|
504
|
+
})) : (v(), f("div", de, [x.value ? (v(), d(a, {
|
|
503
505
|
key: 0,
|
|
504
|
-
onNext:
|
|
506
|
+
onNext: E,
|
|
505
507
|
steps: o
|
|
506
|
-
})) : (
|
|
508
|
+
})) : (v(), d(C(j), {
|
|
507
509
|
key: 1,
|
|
508
510
|
flat: "",
|
|
509
511
|
bordered: ""
|
|
510
512
|
}, {
|
|
511
|
-
default:
|
|
512
|
-
default:
|
|
513
|
-
default:
|
|
513
|
+
default: T(() => [h(C(N), null, {
|
|
514
|
+
default: T(() => [s[7] ||= p("h3", { class: "mb-3 !text-xl font-semibold" }, "Pairing configuration", -1), h(C(F), { onSubmit: P }, {
|
|
515
|
+
default: T(() => [h(C(R), {
|
|
514
516
|
label: "Select Terminal",
|
|
515
517
|
dense: "",
|
|
516
518
|
outlined: "",
|
|
@@ -518,7 +520,7 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
518
520
|
"onUpdate:modelValue": s[2] ||= (e) => b.value = e,
|
|
519
521
|
"option-disable": (e) => e.status.connectivity !== "AVAILABLE",
|
|
520
522
|
"option-label": ({ name: e, terminalId: t }) => e ? `${e} (${t})` : "",
|
|
521
|
-
options:
|
|
523
|
+
options: g.value,
|
|
522
524
|
rules: [(e) => !!e || "Please select terminal."],
|
|
523
525
|
"option-value": "terminalId",
|
|
524
526
|
"outer-label": "Select Terminal",
|
|
@@ -531,18 +533,18 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
531
533
|
"option-label",
|
|
532
534
|
"options",
|
|
533
535
|
"rules"
|
|
534
|
-
]),
|
|
536
|
+
]), p("div", fe, [h(C(A), {
|
|
535
537
|
flat: "",
|
|
536
538
|
"no-caps": "",
|
|
537
539
|
label: "Back",
|
|
538
|
-
"icon-left":
|
|
539
|
-
onClick: s[3] ||= (e) =>
|
|
540
|
-
}, null, 8, ["icon-left"]),
|
|
540
|
+
"icon-left": C(n),
|
|
541
|
+
onClick: s[3] ||= (e) => x.value = !0
|
|
542
|
+
}, null, 8, ["icon-left"]), h(C(A), {
|
|
541
543
|
type: "submit",
|
|
542
544
|
color: "primary",
|
|
543
545
|
unelevated: "",
|
|
544
546
|
"no-caps": "",
|
|
545
|
-
"icon-right":
|
|
547
|
+
"icon-right": C(e),
|
|
546
548
|
label: "Pair Device"
|
|
547
549
|
}, null, 8, ["icon-right"])])]),
|
|
548
550
|
_: 1
|
|
@@ -554,4 +556,4 @@ var re = () => !!localStorage.getItem("till.tid"), Q = () => {
|
|
|
554
556
|
}
|
|
555
557
|
});
|
|
556
558
|
//#endregion
|
|
557
|
-
export {
|
|
559
|
+
export { J as a, K as i, $ as n, q as o, Q as r, pe as t };
|
package/dist/till-payment.d.ts
CHANGED
|
@@ -203,6 +203,18 @@ declare interface PaymentResult {
|
|
|
203
203
|
tipAmount: number | null;
|
|
204
204
|
/** Surcharge amount in cents, or `null` when the provider doesn't report one. */
|
|
205
205
|
surchargeAmount: number | null;
|
|
206
|
+
/**
|
|
207
|
+
* Masked card number (PAN) as reported by the provider, or `null` when the
|
|
208
|
+
* provider doesn't report one. Format varies by provider (e.g.
|
|
209
|
+
* `"**** **** **** 0857"`, `"xxxxxxxxxxxx0857"`).
|
|
210
|
+
*/
|
|
211
|
+
maskedCard: string | null;
|
|
212
|
+
/**
|
|
213
|
+
* Card scheme / company (e.g. `"Visa"`, `"Mastercard"`, `"Amex"`) as reported
|
|
214
|
+
* by the provider, or `null` when the provider doesn't report one. Casing is
|
|
215
|
+
* provider-native and not normalized.
|
|
216
|
+
*/
|
|
217
|
+
cardScheme: string | null;
|
|
206
218
|
/** Normalized receipts. */
|
|
207
219
|
receipts: NormalizedReceipts;
|
|
208
220
|
/** Human-readable message for display. */
|
package/dist/till-payment.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "./till-payment-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./till-payment-C1iLnYV7.js";
|
|
2
2
|
export { a as PairTillPayment, t as SettlementTypes, i as TillPaymentsApi, e as TransactionOutcome, r as TransactionType, n as useTillPayment };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import e from "axios";
|
|
2
2
|
//#region src/utils/index.ts
|
|
3
|
-
var t = () => `${Date.now().toString()}${Math.floor(1e3 + Math.random() * 9e3).toString()}`.slice(0, 16), n = (e = 1e3) => new Promise((t) => setTimeout(t, e)), r = (e) => e && Number(e) >= 500 && Number(e) <= 599, i = (
|
|
3
|
+
var t = () => `${Date.now().toString()}${Math.floor(1e3 + Math.random() * 9e3).toString()}`.slice(0, 16), n = (e = 1e3) => new Promise((t) => setTimeout(t, e)), r = (e) => e && Number(e) >= 500 && Number(e) <= 599, i = (e) => {
|
|
4
|
+
let t = e?.replace(/\s/g, "");
|
|
5
|
+
return t ? `**** **** **** ${t.slice(-4)}` : null;
|
|
6
|
+
}, a = (t) => e.isAxiosError(t) && t.code === "ERR_NETWORK";
|
|
4
7
|
//#endregion
|
|
5
|
-
export { r as i, t as n,
|
|
8
|
+
export { i as a, r as i, t as n, a as r, n as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, c as t, h as n, i as r, l as i, o as a, r as o, t as s, u as c } from "./PairInstructions-BxzivULm.js";
|
|
2
|
-
import { n as l, r as u, t as d } from "./core-
|
|
2
|
+
import { n as l, r as u, t as d } from "./core-BMUVlh-t.js";
|
|
3
3
|
import { createBlock as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, onMounted as v, openBlock as y, ref as b, toDisplayString as x, unref as S, withCtx as C } from "vue";
|
|
4
4
|
import { Dialog as w, Loading as T, Notify as E, QBtn as D, QCard as O, QCardSection as k, QForm as A, QIcon as j, QInput as M, QSelect as N } from "quasar";
|
|
5
5
|
import { useLocalStorage as P } from "@vueuse/core";
|
|
@@ -294,12 +294,14 @@ function H(e) {
|
|
|
294
294
|
}
|
|
295
295
|
var U = (e) => Math.round(e * 100);
|
|
296
296
|
function W(e) {
|
|
297
|
-
let t = e.data && "SaleToPOIResponse" in e.data ? e.data.SaleToPOIResponse.PaymentResponse : void 0, n = t?.PaymentResult?.AmountsResp;
|
|
297
|
+
let t = e.data && "SaleToPOIResponse" in e.data ? e.data.SaleToPOIResponse.PaymentResponse : void 0, n = t?.PaymentResult?.AmountsResp, r = t?.PaymentResult?.PaymentInstrumentData?.CardData;
|
|
298
298
|
return u({
|
|
299
299
|
status: H(e),
|
|
300
300
|
transactionId: t?.POIData?.POITransactionID.TransactionID ?? null,
|
|
301
301
|
amount: n ? U(n.AuthorizedAmount) : null,
|
|
302
302
|
tipAmount: n?.TipAmount === void 0 ? null : U(n.TipAmount),
|
|
303
|
+
maskedCard: r?.MaskedPan ?? null,
|
|
304
|
+
cardScheme: r?.PaymentBrand ?? null,
|
|
303
305
|
receipts: e.data ? V(e.data) : {},
|
|
304
306
|
message: e.message,
|
|
305
307
|
raw: e.data ?? null
|
package/dist/valpay.d.ts
CHANGED
|
@@ -475,6 +475,18 @@ declare interface PaymentResult_2 {
|
|
|
475
475
|
tipAmount: number | null;
|
|
476
476
|
/** Surcharge amount in cents, or `null` when the provider doesn't report one. */
|
|
477
477
|
surchargeAmount: number | null;
|
|
478
|
+
/**
|
|
479
|
+
* Masked card number (PAN) as reported by the provider, or `null` when the
|
|
480
|
+
* provider doesn't report one. Format varies by provider (e.g.
|
|
481
|
+
* `"**** **** **** 0857"`, `"xxxxxxxxxxxx0857"`).
|
|
482
|
+
*/
|
|
483
|
+
maskedCard: string | null;
|
|
484
|
+
/**
|
|
485
|
+
* Card scheme / company (e.g. `"Visa"`, `"Mastercard"`, `"Amex"`) as reported
|
|
486
|
+
* by the provider, or `null` when the provider doesn't report one. Casing is
|
|
487
|
+
* provider-native and not normalized.
|
|
488
|
+
*/
|
|
489
|
+
cardScheme: string | null;
|
|
478
490
|
/** Normalized receipts. */
|
|
479
491
|
receipts: NormalizedReceipts;
|
|
480
492
|
/** Human-readable message for display. */
|
package/dist/valpay.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./valpay
|
|
1
|
+
import { n as e, r as t, t as n } from "./valpay-DVV1AH4F.js";
|
|
2
2
|
export { n as PairValpay, t as ValpayAPI, e as useValpay };
|