@achyutlabsau/vue-payment-gateway 0.7.1 → 0.8.1

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 (23) hide show
  1. package/dist/PBtn.vue_vue_type_script_setup_true_lang-BZRHAS0P.js +20 -0
  2. package/dist/{PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js → PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js} +20 -21
  3. package/dist/{PairLinkly.vue_vue_type_script_setup_true_lang-DMoZH_qZ.js → PairLinkly.vue_vue_type_script_setup_true_lang-OzYd90mq.js} +14 -11
  4. package/dist/{PairMX51.vue_vue_type_script_setup_true_lang-WOcvKdRl.js → PairMX51.vue_vue_type_script_setup_true_lang-DHGuS3zp.js} +9 -10
  5. package/dist/{PairSmartPay.vue_vue_type_script_setup_true_lang--WeZf2Sw.js → PairSmartPay.vue_vue_type_script_setup_true_lang-BxMFKCdq.js} +9 -9
  6. package/dist/{PairTillPayment.vue_vue_type_script_setup_true_lang-BZgsUFdv.js → PairTillPayment.vue_vue_type_script_setup_true_lang-Cy392bZw.js} +9 -10
  7. package/dist/{PairTyro.vue_vue_type_script_setup_true_lang-_sTaWomK.js → PairTyro.vue_vue_type_script_setup_true_lang-ClmlRTyD.js} +7 -9
  8. package/dist/{TransactionDialog.vue_vue_type_script_setup_true_lang-DTIELKw0.js → TransactionDialog.vue_vue_type_script_setup_true_lang-C6l6nnLB.js} +19 -24
  9. package/dist/index.d.ts +32 -25
  10. package/dist/index.js +15 -14
  11. package/dist/linkly.d.ts +32 -16
  12. package/dist/linkly.js +1 -1
  13. package/dist/mx51.d.ts +30 -20
  14. package/dist/mx51.js +34 -30
  15. package/dist/smartpay.d.ts +28 -5
  16. package/dist/smartpay.js +1 -1
  17. package/dist/till-payment.d.ts +29 -7
  18. package/dist/till-payment.js +1 -1
  19. package/dist/tyro.d.ts +30 -18
  20. package/dist/tyro.js +1 -1
  21. package/dist/worldline.d.ts +32 -15
  22. package/dist/worldline.js +22 -39
  23. package/package.json +93 -92
@@ -0,0 +1,20 @@
1
+ import { defineComponent, createBlock, openBlock, unref } from "vue";
2
+ import { QBtn } from "quasar";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "PBtn",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return openBlock(), createBlock(unref(QBtn), {
8
+ label: "Cancel",
9
+ color: "primary",
10
+ size: "16px",
11
+ class: "!py-2.5",
12
+ unelevated: "",
13
+ ripple: false
14
+ });
15
+ };
16
+ }
17
+ });
18
+ export {
19
+ _sfc_main as _
20
+ };
@@ -1,5 +1,6 @@
1
1
  import { reactive, ref, defineComponent, createBlock, openBlock, unref, withCtx, createElementVNode, createVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
2
- import { QCard, QIcon, QBtn } from "quasar";
2
+ import { QCard, QIcon } from "quasar";
3
+ import { _ as _sfc_main$1 } from "./PBtn.vue_vue_type_script_setup_true_lang-BZRHAS0P.js";
3
4
  var PaymentGateways = /* @__PURE__ */ ((PaymentGateways2) => {
4
5
  PaymentGateways2["Tyro"] = "tyro";
5
6
  PaymentGateways2["TillPayment"] = "till-instore";
@@ -23,6 +24,7 @@ const state = reactive({
23
24
  mx51DeviceApiKey: ""
24
25
  });
25
26
  const environment = ref("production");
27
+ const isDense = ref(true);
26
28
  const isPluginInitialized = ref(false);
27
29
  const setState = (options) => {
28
30
  options.productName && (state.productName = options.productName);
@@ -54,7 +56,7 @@ const _hoisted_2 = { class: "flex items-center justify-center" };
54
56
  const _hoisted_3 = { class: "mb-8 space-y-4" };
55
57
  const _hoisted_4 = { class: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gray-100 font-semibold dark:bg-gray-700" };
56
58
  const _hoisted_5 = { class: "text-gray-700 dark:text-gray-200" };
57
- const _hoisted_6 = { class: "mb-6 flex items-start space-x-3 rounded-lg bg-amber-50 p-4 dark:bg-slate-700" };
59
+ const _hoisted_6 = { class: "mb-6 flex items-start space-x-3 rounded-lg bg-amber-50 p-4 text-base dark:bg-slate-700" };
58
60
  const _hoisted_7 = { class: "flex justify-end" };
59
61
  const _sfc_main = /* @__PURE__ */ defineComponent({
60
62
  __name: "PairInstructions",
@@ -70,18 +72,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
70
72
  createElementVNode("div", _hoisted_2, [
71
73
  createVNode(unref(QIcon), {
72
74
  name: unref(mdiDevices),
73
- size: "3rem",
75
+ size: "4rem",
74
76
  class: "text-primary"
75
77
  }, null, 8, ["name"])
76
78
  ]),
77
- _cache[1] || (_cache[1] = createElementVNode("h2", { class: "text-center text-2xl font-bold" }, "Terminal Setup Instructions", -1)),
78
- _cache[2] || (_cache[2] = createElementVNode("p", { class: "text-center text-gray-600 dark:text-gray-200" }, "Please follow these steps to pair your terminal", -1))
79
+ _cache[1] || (_cache[1] = createElementVNode("h2", { class: "text-center text-2xl !font-medium" }, "Terminal Setup Instructions", -1)),
80
+ _cache[2] || (_cache[2] = createElementVNode("p", { class: "text-center text-base text-gray-600 dark:text-gray-200" }, " Please follow these steps to pair your terminal ", -1))
79
81
  ]),
80
82
  createElementVNode("ul", _hoisted_3, [
81
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.steps, (step, index) => {
83
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.steps, (step, index) => {
82
84
  return openBlock(), createElementBlock("li", {
83
85
  key: index,
84
- class: "flex items-center space-x-3"
86
+ class: "flex items-center space-x-3 text-base"
85
87
  }, [
86
88
  createElementVNode("span", _hoisted_4, toDisplayString(index + 1), 1),
87
89
  createElementVNode("span", _hoisted_5, toDisplayString(step), 1)
@@ -91,7 +93,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
91
93
  createElementVNode("div", _hoisted_6, [
92
94
  createVNode(unref(QIcon), {
93
95
  name: unref(mdiInformation),
94
- size: "sm",
96
+ size: "md",
95
97
  class: "mt-0.5 text-amber-500 dark:text-white"
96
98
  }, null, 8, ["name"]),
97
99
  _cache[3] || (_cache[3] = createElementVNode("div", { class: "flex-1" }, [
@@ -100,13 +102,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
102
  ], -1))
101
103
  ]),
102
104
  createElementVNode("div", _hoisted_7, [
103
- createVNode(unref(QBtn), {
104
- color: "primary",
105
- unelevated: "",
105
+ createVNode(_sfc_main$1, {
106
106
  "icon-right": "chevron_right",
107
107
  label: "Next",
108
- "no-caps": "",
109
- ripple: false,
110
108
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("next"))
111
109
  })
112
110
  ])
@@ -119,15 +117,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
117
  export {
120
118
  PaymentGateways as P,
121
119
  _sfc_main as _,
122
- setEnvironment as a,
123
- state as b,
124
- mdiRefresh as c,
125
- mdiChevronLeft as d,
120
+ isPluginInitialized as a,
121
+ setEnvironment as b,
122
+ state as c,
123
+ mdiRefresh as d,
126
124
  environment as e,
127
- mdiLink as f,
128
- checkPluginInitialized as g,
129
- mdiBarcode as h,
130
- isPluginInitialized as i,
125
+ mdiChevronLeft as f,
126
+ mdiLink as g,
127
+ checkPluginInitialized as h,
128
+ isDense as i,
129
+ mdiBarcode as j,
131
130
  mdiCheckCircle as m,
132
131
  setState as s
133
132
  };
@@ -4,8 +4,8 @@ import { i as isNetworkError, a as isServerError, d as delay, g as generateTrans
4
4
  import axios, { isAxiosError, HttpStatusCode } from "axios";
5
5
  import { v7 } from "uuid";
6
6
  import { d as dialogDefaultOpts } from "./utils-GrbVNAXw.js";
7
- import { e as environment, b as state, m as mdiCheckCircle, d as mdiChevronLeft, c as mdiRefresh, _ as _sfc_main$3, f as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js";
8
- import { _ as _sfc_main$2 } from "./TransactionDialog.vue_vue_type_script_setup_true_lang-DTIELKw0.js";
7
+ import { e as environment, c as state, m as mdiCheckCircle, f as mdiChevronLeft, d as mdiRefresh, _ as _sfc_main$3, g as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js";
8
+ import { _ as _sfc_main$2 } from "./TransactionDialog.vue_vue_type_script_setup_true_lang-C6l6nnLB.js";
9
9
  import { useLocalStorage } from "@vueuse/core";
10
10
  const LINKLY_CONSTANTS = {
11
11
  PATHS: {
@@ -115,7 +115,9 @@ class LinklyPaymentGateway {
115
115
  throw new Error("No valid authentication method available");
116
116
  }
117
117
  } catch (error) {
118
- throw new Error("Failed to renew authentication token. Please check your Linkly account credentials.");
118
+ throw new Error("Failed to renew authentication token. Please check your Linkly account credentials.", {
119
+ cause: error
120
+ });
119
121
  }
120
122
  }
121
123
  }
@@ -174,7 +176,7 @@ class LinklyPaymentGateway {
174
176
  console.error("Get token error:", error);
175
177
  if (axios.isAxiosError(error) && error.response?.status === HttpStatusCode.Unauthorized) {
176
178
  this._clearCredentials();
177
- throw new Error("Authentication failed. Pairing may have been reset or credentials changed.");
179
+ throw new Error("Authentication failed. Pairing may have been reset or credentials changed.", { cause: error });
178
180
  }
179
181
  throw error;
180
182
  }
@@ -199,7 +201,7 @@ class LinklyPaymentGateway {
199
201
  await this.getLinklyAuthToken();
200
202
  return this.sendTransactionRequest(data);
201
203
  } catch {
202
- throw new Error("Failed to authenticate. Please check your Linkly account credentials.");
204
+ throw new Error("Failed to authenticate. Please check your Linkly account credentials.", { cause: error });
203
205
  }
204
206
  }
205
207
  if (status === HttpStatusCode.RequestTimeout || isServerError(error)) {
@@ -229,7 +231,9 @@ class LinklyPaymentGateway {
229
231
  interval = Math.min(interval + INTERVAL_INCREMENT, MAX_INTERVAL_TIME);
230
232
  return doRequest();
231
233
  }
232
- throw new Error("Unable to get the transaction details. Please contact service provider!");
234
+ throw new Error("Unable to get the transaction details. Please contact service provider!", {
235
+ cause: error
236
+ });
233
237
  } else if (status === HttpStatusCode.Unauthorized) {
234
238
  await this.getLinklyAuthToken();
235
239
  return doRequest();
@@ -255,7 +259,7 @@ class LinklyPaymentGateway {
255
259
  params: DEFAULT_REQUEST_PARAMS
256
260
  });
257
261
  const isSuccess = res.data?.response?.success ?? false;
258
- const message = isSuccess ? "Receipt printed successfully." : "Failed to print receipt: " + res.data?.response?.responseText;
262
+ const message = isSuccess ? "Receipt printed successfully." : `Failed to print receipt: ${res.data?.response?.responseText}`;
259
263
  return {
260
264
  success: isSuccess,
261
265
  message,
@@ -540,7 +544,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
540
544
  createVNode(unref(QToolbarTitle), null, {
541
545
  default: withCtx(() => [
542
546
  renderSlot(_ctx.$slots, "title", {}, () => [
543
- _cache[2] || (_cache[2] = createTextVNode("Reprint Receipt"))
547
+ _cache[2] || (_cache[2] = createTextVNode("Reprint Receipt", -1))
544
548
  ])
545
549
  ]),
546
550
  _: 3
@@ -559,7 +563,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
559
563
  createVNode(unref(QCardSection), null, {
560
564
  default: withCtx(() => [
561
565
  createElementVNode("div", _hoisted_1$1, [
562
- _cache[3] || (_cache[3] = createTextVNode(" Txn Number: ")),
566
+ _cache[3] || (_cache[3] = createTextVNode(" Txn Number: ", -1)),
563
567
  createVNode(unref(QInput), {
564
568
  modelValue: txnNumber.value,
565
569
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => txnNumber.value = $event),
@@ -770,8 +774,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
770
774
  _: 1
771
775
  })
772
776
  ]),
773
- _: 1,
774
- __: [7]
777
+ _: 1
775
778
  }))
776
779
  ])),
777
780
  createVNode(_sfc_main$1, {
@@ -1,8 +1,9 @@
1
1
  import { defineComponent, ref, computed, onMounted, watch, resolveDirective, createElementBlock, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createCommentVNode, toDisplayString, withDirectives } from "vue";
2
- import { QCard, QForm, QSelect, QInput, QIcon, QBtn, QDialog, QCardSection, Dialog } from "quasar";
2
+ import { QCard, QForm, QSelect, QInput, QIcon, QDialog, QCardSection, Dialog } from "quasar";
3
3
  import { Spi, TransactionOptions, SuccessState, TransactionType, SpiStatus } from "@mx51/spi-client-js";
4
4
  import { useEventListener } from "@vueuse/core";
5
- import { b as state, _ as _sfc_main$1 } from "./PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js";
5
+ import { c as state, _ as _sfc_main$1 } from "./PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js";
6
+ import { _ as _sfc_main$2 } from "./PBtn.vue_vue_type_script_setup_true_lang-BZRHAS0P.js";
6
7
  const spiSettings = {
7
8
  secureWebSockets: true,
8
9
  // checks for HTTPs
@@ -447,7 +448,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
447
448
  _cache[9] || (_cache[9] = createElementVNode("div", null, "Paired and trying to connect", -1))
448
449
  ])) : createCommentVNode("", true)
449
450
  ]),
450
- !isPaired.value ? (openBlock(), createBlock(unref(QBtn), {
451
+ !isPaired.value ? (openBlock(), createBlock(_sfc_main$2, {
451
452
  key: 0,
452
453
  label: "Pair",
453
454
  type: "submit",
@@ -456,7 +457,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
456
457
  unelevated: "",
457
458
  "no-caps": "",
458
459
  ripple: false
459
- })) : (openBlock(), createBlock(unref(QBtn), {
460
+ })) : (openBlock(), createBlock(_sfc_main$2, {
460
461
  key: 1,
461
462
  label: "Unpair",
462
463
  type: "button",
@@ -482,7 +483,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
482
483
  pairInfo.value.state === "INPROGRESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 0 }, {
483
484
  default: withCtx(() => [
484
485
  createElementVNode("div", _hoisted_8, toDisplayString(pairInfo.value.message), 1),
485
- createVNode(unref(QBtn), {
486
+ createVNode(_sfc_main$2, {
486
487
  label: "Cancel",
487
488
  onClick: unref(cancelPairing),
488
489
  color: "primary",
@@ -500,12 +501,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
500
501
  createElementVNode("div", _hoisted_9, toDisplayString(pairInfo.value.confirmationCode), 1),
501
502
  _cache[12] || (_cache[12] = createElementVNode("div", { class: "text-center text-sm text-gray-500 dark:text-gray-300" }, " Confirm the matching pairing code on the terminal ", -1))
502
503
  ]),
503
- _: 1,
504
- __: [11, 12]
504
+ _: 1
505
505
  })) : pairInfo.value.state === "FINISHED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
506
506
  default: withCtx(() => [
507
507
  createElementVNode("div", _hoisted_10, toDisplayString(pairInfo.value.message), 1),
508
- withDirectives(createVNode(unref(QBtn), {
508
+ withDirectives(createVNode(_sfc_main$2, {
509
509
  label: "OK",
510
510
  color: "primary",
511
511
  outline: "",
@@ -526,8 +526,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
526
526
  _: 1
527
527
  }, 8, ["modelValue"])
528
528
  ]),
529
- _: 1,
530
- __: [13]
529
+ _: 1
531
530
  }))
532
531
  ]);
533
532
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, createBlock, createElementBlock, unref, openBlock, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, withModifiers } from "vue";
2
2
  import { useLocalStorage } from "@vueuse/core";
3
3
  import { Dialog, QCard, QIcon, QBtn, QInput } from "quasar";
4
- import { b as state, e as environment, m as mdiCheckCircle, c as mdiRefresh, _ as _sfc_main$1, d as mdiChevronLeft, f as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js";
4
+ import { c as state, e as environment, m as mdiCheckCircle, d as mdiRefresh, _ as _sfc_main$1, f as mdiChevronLeft, g as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js";
5
5
  import axios, { HttpStatusCode, isAxiosError } from "axios";
6
6
  import { d as delay } from "./index-e4lpzJsL.js";
7
7
  import { d as dialogDefaultOpts } from "./utils-GrbVNAXw.js";
@@ -152,7 +152,7 @@ class SmartConnectAPI {
152
152
  await delay();
153
153
  return poll();
154
154
  } else {
155
- throw new Error("Polling timed out");
155
+ throw new Error("Polling timed out", { cause: error });
156
156
  }
157
157
  }
158
158
  };
@@ -289,10 +289,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
289
289
  setup(__props) {
290
290
  const SETUP_STEPS = [
291
291
  'Press the "Menu" Button',
292
- 'Select "Configuration"',
293
- 'Select "Integrated EFTPOS"',
294
- 'Select "Pair with POS"',
295
- 'Press "Start"'
292
+ "Select 'CONFIG'",
293
+ "Enter authentication code and press 'Enter'",
294
+ "Select 'POS Integrations'",
295
+ "Select 'Authorise POS'",
296
+ "You will get a new 'Pairing code'. Enter that in the form on next screen"
296
297
  ];
297
298
  const { pairTerminal } = useSmartPay();
298
299
  const pairConfig = useLocalStorage("smartpay.pairConfig", {
@@ -331,7 +332,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
331
332
  ]),
332
333
  _cache[3] || (_cache[3] = createElementVNode("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1)),
333
334
  createElementVNode("p", _hoisted_3, [
334
- _cache[2] || (_cache[2] = createTextVNode(" Pairing Code: ")),
335
+ _cache[2] || (_cache[2] = createTextVNode(" Pairing Code: ", -1)),
335
336
  createElementVNode("span", _hoisted_4, toDisplayString(unref(pairConfig).pairingCode), 1)
336
337
  ]),
337
338
  createElementVNode("p", _hoisted_5, " Last paired: " + toDisplayString(new Date(unref(pairConfig).lastPairedDate).toLocaleString()), 1),
@@ -392,8 +393,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
392
393
  ])
393
394
  ], 32)
394
395
  ]),
395
- _: 1,
396
- __: [4]
396
+ _: 1
397
397
  }))
398
398
  ]));
399
399
  };
@@ -4,8 +4,8 @@ import axios, { isAxiosError, HttpStatusCode } from "axios";
4
4
  import dayjs from "dayjs";
5
5
  import { Loading, Dialog, QDialog, QCard, QForm, QToolbar, QToolbarTitle, QIcon, QCardSection, QInput, QCardActions, QBtn, Notify, QSelect } from "quasar";
6
6
  import { d as delay } from "./index-e4lpzJsL.js";
7
- import { b as state, m as mdiCheckCircle, d as mdiChevronLeft, c as mdiRefresh, _ as _sfc_main$3, f as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js";
8
- import { _ as _sfc_main$2 } from "./TransactionDialog.vue_vue_type_script_setup_true_lang-DTIELKw0.js";
7
+ import { c as state, m as mdiCheckCircle, f as mdiChevronLeft, d as mdiRefresh, _ as _sfc_main$3, g as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js";
8
+ import { _ as _sfc_main$2 } from "./TransactionDialog.vue_vue_type_script_setup_true_lang-C6l6nnLB.js";
9
9
  import { validate } from "uuid";
10
10
  var SettlementTypes = /* @__PURE__ */ ((SettlementTypes2) => {
11
11
  SettlementTypes2["SETTLEMENT"] = "SETTLEMENT";
@@ -65,7 +65,7 @@ const generateReceipt = (receiptName, rawReceipt) => {
65
65
  const currencyWidth = 8;
66
66
  const amountWidth = 10;
67
67
  const formatLine = (type, amount) => {
68
- return `${type.padEnd(typeWidth)}${" AUD".padEnd(currencyWidth)}${("$" + amount).padStart(amountWidth)}`;
68
+ return `${type.padEnd(typeWidth)}${" AUD".padEnd(currencyWidth)}${`$${amount}`.padStart(amountWidth)}`;
69
69
  };
70
70
  const header = ` ${receiptName}
71
71
 
@@ -98,7 +98,7 @@ ${data.tvr ? `TVR: ${data.tvr}
98
98
  Terminal ID: ${terminalId}
99
99
  ${dayjs(data.dateTime).format("DD MMM YYYY [at] hh:mm A")}
100
100
 
101
- ${data.authorizationMethod !== "NONE" ? data.authorizationMethod + " APPROVED" : "APPROVED"}
101
+ ${data.authorizationMethod !== "NONE" ? `${data.authorizationMethod} APPROVED` : "APPROVED"}
102
102
  `;
103
103
  return [
104
104
  header,
@@ -569,7 +569,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
569
569
  createVNode(unref(QToolbarTitle), null, {
570
570
  default: withCtx(() => [
571
571
  renderSlot(_ctx.$slots, "title", {}, () => [
572
- _cache[2] || (_cache[2] = createTextVNode("Reprint Receipt"))
572
+ _cache[2] || (_cache[2] = createTextVNode("Reprint Receipt", -1))
573
573
  ])
574
574
  ]),
575
575
  _: 3
@@ -588,7 +588,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
588
588
  createVNode(unref(QCardSection), null, {
589
589
  default: withCtx(() => [
590
590
  createElementVNode("div", _hoisted_1$1, [
591
- _cache[3] || (_cache[3] = createTextVNode(" Txn Number: ")),
591
+ _cache[3] || (_cache[3] = createTextVNode(" Txn Number: ", -1)),
592
592
  createVNode(unref(QInput), {
593
593
  modelValue: txnNumber.value,
594
594
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => txnNumber.value = $event),
@@ -720,11 +720,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
720
720
  ]),
721
721
  _cache[6] || (_cache[6] = createElementVNode("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1)),
722
722
  createElementVNode("p", _hoisted_3, [
723
- _cache[4] || (_cache[4] = createTextVNode(" Terminal ID: ")),
723
+ _cache[4] || (_cache[4] = createTextVNode(" Terminal ID: ", -1)),
724
724
  createElementVNode("b", null, toDisplayString(unref(pairConfig).terminalId), 1)
725
725
  ]),
726
726
  createElementVNode("p", _hoisted_4, [
727
- _cache[5] || (_cache[5] = createTextVNode(" Last paired: ")),
727
+ _cache[5] || (_cache[5] = createTextVNode(" Last paired: ", -1)),
728
728
  createElementVNode("b", null, toDisplayString(new Date(unref(pairConfig).lastPairedDate).toLocaleString()), 1)
729
729
  ]),
730
730
  createElementVNode("div", _hoisted_5, [
@@ -801,8 +801,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
801
801
  _: 1
802
802
  })
803
803
  ]),
804
- _: 1,
805
- __: [7]
804
+ _: 1
806
805
  }))
807
806
  ]),
808
807
  _: 1
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, useModel, resolveDirective, createBlock, openBlock, unref, withCtx, createVNode, createElementVNode, withDirectives, createTextVNode, ref, createElementBlock, toDisplayString, withModifiers } from "vue";
2
2
  import { useLocalStorage } from "@vueuse/core";
3
3
  import { QSpinnerHourglass, Dialog, QDialog, QCard, QToolbar, QToolbarTitle, QIcon, QBtn, QInput } from "quasar";
4
- import { g as checkPluginInitialized, e as environment, b as state, m as mdiCheckCircle, c as mdiRefresh, _ as _sfc_main$2, h as mdiBarcode, d as mdiChevronLeft, f as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-gQoPMiBm.js";
4
+ import { h as checkPluginInitialized, e as environment, c as state, m as mdiCheckCircle, d as mdiRefresh, _ as _sfc_main$2, j as mdiBarcode, f as mdiChevronLeft, g as mdiLink } from "./PairInstructions.vue_vue_type_script_setup_true_lang-Ckf0Q7kS.js";
5
5
  const dialogDefaultOpts = {
6
6
  message: "Pairing in progress...",
7
7
  class: "text-lg",
@@ -138,11 +138,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
138
138
  createVNode(unref(QToolbar), { class: "bg-primary text-white" }, {
139
139
  default: withCtx(() => [
140
140
  createVNode(unref(QToolbarTitle), null, {
141
- default: withCtx(() => _cache[1] || (_cache[1] = [
142
- createTextVNode(" Tyro Client Logs ")
143
- ])),
144
- _: 1,
145
- __: [1]
141
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
142
+ createTextVNode(" Tyro Client Logs ", -1)
143
+ ])]),
144
+ _: 1
146
145
  }),
147
146
  withDirectives(createVNode(unref(QIcon), {
148
147
  class: "float-right cursor-pointer rounded p-2 transition-colors",
@@ -234,7 +233,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
234
233
  ]),
235
234
  _cache[5] || (_cache[5] = createElementVNode("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1)),
236
235
  createElementVNode("p", _hoisted_3, [
237
- _cache[4] || (_cache[4] = createTextVNode(" Terminal ID: ")),
236
+ _cache[4] || (_cache[4] = createTextVNode(" Terminal ID: ", -1)),
238
237
  createElementVNode("span", _hoisted_4, toDisplayString(unref(pairConfig).terminalId), 1)
239
238
  ]),
240
239
  createElementVNode("p", _hoisted_5, " Last paired: " + toDisplayString(new Date(unref(pairConfig).lastPairedDate).toLocaleString()), 1),
@@ -317,8 +316,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
317
316
  ])
318
317
  ], 32)
319
318
  ]),
320
- _: 1,
321
- __: [6]
319
+ _: 1
322
320
  }))
323
321
  ]));
324
322
  };
@@ -1,8 +1,9 @@
1
1
  import { defineComponent, resolveDirective, createBlock, openBlock, unref, withCtx, createVNode, createCommentVNode, createElementVNode, toDisplayString, withDirectives } from "vue";
2
- import { useDialogPluginComponent, QDialog, QCard, QCardSection, QBtn } from "quasar";
3
- const _hoisted_1 = { class: "text-center font-semibold text-gray-500 uppercase" };
4
- const _hoisted_2 = { class: "text-center font-semibold text-gray-500 uppercase" };
5
- const _hoisted_3 = { class: "text-center font-semibold text-gray-500 uppercase" };
2
+ import { useDialogPluginComponent, QDialog, QCard, QCardSection } from "quasar";
3
+ import { _ as _sfc_main$1 } from "./PBtn.vue_vue_type_script_setup_true_lang-BZRHAS0P.js";
4
+ const _hoisted_1 = { class: "text-center text-lg font-semibold uppercase text-gray-500" };
5
+ const _hoisted_2 = { class: "text-center text-lg font-semibold uppercase text-gray-500" };
6
+ const _hoisted_3 = { class: "text-center text-lg font-semibold uppercase text-gray-500" };
6
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
8
  __name: "TransactionDialog",
8
9
  props: {
@@ -26,47 +27,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
27
  persistent: ""
27
28
  }, {
28
29
  default: withCtx(() => [
29
- createVNode(unref(QCard), { class: "q-dialog-plugin" }, {
30
+ createVNode(unref(QCard), { class: "q-dialog-plugin px-6 py-3" }, {
30
31
  default: withCtx(() => [
31
- _ctx.title === "INPROGRESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 0 }, {
32
+ __props.title === "INPROGRESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 0 }, {
32
33
  default: withCtx(() => [
33
- createElementVNode("div", _hoisted_1, toDisplayString(_ctx.message), 1),
34
- createVNode(unref(QBtn), {
34
+ createElementVNode("div", _hoisted_1, toDisplayString(__props.message), 1),
35
+ createVNode(_sfc_main$1, {
35
36
  label: "Cancel",
36
- onClick: _ctx.cancelTxn,
37
+ onClick: __props.cancelTxn,
37
38
  color: "primary",
38
39
  outline: "",
39
- class: "!mt-6 !w-full",
40
- unelevated: "",
41
- ripple: false
40
+ class: "!mt-6 !w-full"
42
41
  }, null, 8, ["onClick"])
43
42
  ]),
44
43
  _: 1
45
- })) : _ctx.title === "SUCCESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 1 }, {
44
+ })) : __props.title === "SUCCESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 1 }, {
46
45
  default: withCtx(() => [
47
- createElementVNode("div", _hoisted_2, toDisplayString(_ctx.message), 1),
48
- withDirectives(createVNode(unref(QBtn), {
46
+ createElementVNode("div", _hoisted_2, toDisplayString(__props.message), 1),
47
+ withDirectives(createVNode(_sfc_main$1, {
49
48
  label: "OK",
50
49
  color: "primary",
51
50
  outline: "",
52
- class: "!mt-6 !w-full",
53
- unelevated: "",
54
- ripple: false
51
+ class: "!mt-6 !w-full"
55
52
  }, null, 512), [
56
53
  [_directive_close_popup]
57
54
  ])
58
55
  ]),
59
56
  _: 1
60
- })) : _ctx.title === "FAILED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
57
+ })) : __props.title === "FAILED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
61
58
  default: withCtx(() => [
62
- createElementVNode("div", _hoisted_3, toDisplayString(_ctx.message), 1),
63
- withDirectives(createVNode(unref(QBtn), {
59
+ createElementVNode("div", _hoisted_3, toDisplayString(__props.message), 1),
60
+ withDirectives(createVNode(_sfc_main$1, {
64
61
  label: "OK",
65
62
  color: "primary",
66
63
  outline: "",
67
- class: "!mt-6 !w-full",
68
- unelevated: "",
69
- ripple: false
64
+ class: "!mt-6 !w-full"
70
65
  }, null, 512), [
71
66
  [_directive_close_popup]
72
67
  ])
package/dist/index.d.ts CHANGED
@@ -1,13 +1,5 @@
1
- import { ComponentOptionsMixin } from 'vue';
2
- import { ComponentProvideOptions } from 'vue';
3
- import { DefineComponent } from 'vue';
4
1
  import { FunctionPlugin } from 'vue';
5
- import { PublicProps } from 'vue';
6
-
7
- declare type __VLS_Props = {
8
- gateway: PaymentGateways;
9
- merchantId: string | number;
10
- };
2
+ import { default as PairingInterface } from './components/PairingInterface.vue';
11
3
 
12
4
  declare const _default: {
13
5
  install: FunctionPlugin<[InstallOptions]>;
@@ -30,6 +22,10 @@ export declare const generateTransactionId: () => string;
30
22
 
31
23
  declare interface InstallOptions extends POSConfig {
32
24
  environment?: Environment;
25
+ /**
26
+ * @default true
27
+ */
28
+ dense?: boolean;
33
29
  /**
34
30
  *
35
31
  * @param receipt - receipt string
@@ -38,22 +34,7 @@ declare interface InstallOptions extends POSConfig {
38
34
  onReceiptPrint?: (receipt: string, type: ReceiptTypes) => void;
39
35
  }
40
36
 
41
- export declare const PairingInterface: DefineComponent<__VLS_Props, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
42
- "pairing-success": (data: any, gateway: PaymentGateways) => any;
43
- "pairing-failure": (data: any) => any;
44
- }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
45
- "onPairing-success"?: ((data: any, gateway: PaymentGateways) => any) | undefined;
46
- "onPairing-failure"?: ((data: any) => any) | undefined;
47
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
48
-
49
- declare enum PaymentGateways {
50
- Tyro = "tyro",
51
- TillPayment = "till-instore",
52
- MX51 = "mx51-spi",
53
- Linkly = "linkly",
54
- SmartPay = "smartpay",
55
- ANZ = "anz-instore"
56
- }
37
+ export { PairingInterface }
57
38
 
58
39
  declare interface POSConfig {
59
40
  productName: string;
@@ -76,3 +57,29 @@ declare enum ReceiptTypes {
76
57
  }
77
58
 
78
59
  export { }
60
+
61
+
62
+ declare global {
63
+ interface HTMLElementEventMap extends CustomEventMap {
64
+ }
65
+ interface WindowEventMap extends CustomEventMap {
66
+ }
67
+ interface DocumentEventMap extends CustomEventMap {
68
+ }
69
+ }
70
+
71
+
72
+ declare global {
73
+ interface CustomEventMap {
74
+ [TimApiEvents.TxnCompleted]: CustomEvent<{
75
+ event: timapi.TimEvent;
76
+ data: timapi.TransactionResponse;
77
+ }>;
78
+ [TimApiEvents.BalanceCompleted]: CustomEvent<{
79
+ event: timapi.TimEvent;
80
+ data: timapi.TransactionResponse;
81
+ }>;
82
+ }
83
+ interface DocumentEventMap extends CustomEventMap {
84
+ }
85
+ }