@achyutlabsau/vue-payment-gateway 0.2.6 → 0.2.7
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/{event-Zm-ArxiV.js → event-BWbN5627.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/mx51.js +29 -14
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Spi, TransactionOptions, SuccessState, TransactionType } from "@mx51/spi-client-js";
|
|
2
2
|
const spiSettings = {
|
|
3
|
-
secureWebSockets:
|
|
3
|
+
secureWebSockets: true,
|
|
4
4
|
// checks for HTTPs
|
|
5
5
|
printMerchantCopyOnEftpos: false,
|
|
6
6
|
// prints merchant receipt from terminal instead of POS
|
|
@@ -98,9 +98,9 @@ document.addEventListener("TxFlowStateChanged", (e) => {
|
|
|
98
98
|
document.addEventListener("DeviceAddressChanged", (e) => {
|
|
99
99
|
log("Device address changed", e);
|
|
100
100
|
if (e == null ? void 0 : e.detail.ip) {
|
|
101
|
-
window.localStorage.setItem("eftposAddress",
|
|
101
|
+
window.localStorage.setItem("eftposAddress", e.detail.ip);
|
|
102
102
|
} else if (e == null ? void 0 : e.detail.fqdn) {
|
|
103
|
-
window.localStorage.setItem("eftposAddress",
|
|
103
|
+
window.localStorage.setItem("eftposAddress", e.detail.fqdn);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
spi.TerminalConfigurationResponse = (e) => {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { s as setState, a as setEnvironment, i as isPluginInitialized } from "./
|
|
|
2
2
|
import "quasar";
|
|
3
3
|
import { T as TYRO_CONSTANTS } from "./tyro.enums-OZuKaM2C.js";
|
|
4
4
|
import { useScriptTag } from "@vueuse/core";
|
|
5
|
-
import { s as spi } from "./event-
|
|
5
|
+
import { s as spi } from "./event-BWbN5627.js";
|
|
6
6
|
import "vue";
|
|
7
7
|
import "@mx51/spi-client-js";
|
|
8
8
|
import "uuid";
|
package/dist/mx51.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as log, s as spi, g as getPairingData, a as getTenants, r as receiptOptions } from "./event-
|
|
2
|
-
import { defineComponent, ref, computed, onMounted, resolveDirective, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, createBlock, toDisplayString, withDirectives } from "vue";
|
|
1
|
+
import { l as log, s as spi, g as getPairingData, a as getTenants, r as receiptOptions } from "./event-BWbN5627.js";
|
|
2
|
+
import { defineComponent, ref, computed, onMounted, watch, resolveDirective, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, createBlock, toDisplayString, withDirectives } from "vue";
|
|
3
3
|
import { QForm, QSelect, QInput, QCheckbox, QIcon, QBtn, QDialog, QCard, QCardSection, Dialog } from "quasar";
|
|
4
4
|
import { useEventListener, useLocalStorage } from "@vueuse/core";
|
|
5
5
|
import { SpiStatus, SuccessState, TransactionType } from "@mx51/spi-client-js";
|
|
@@ -28,7 +28,7 @@ function cancelPairing() {
|
|
|
28
28
|
log("Pairing cancelled");
|
|
29
29
|
spi.PairingCancel();
|
|
30
30
|
}
|
|
31
|
-
const _hoisted_1$1 = { class: "my-6 w-full max-w-
|
|
31
|
+
const _hoisted_1$1 = { class: "my-6 w-full max-w-xl rounded-md bg-white p-6 shadow-md" };
|
|
32
32
|
const _hoisted_2$1 = { class: "rounded bg-gray-100 p-3" };
|
|
33
33
|
const _hoisted_3$1 = {
|
|
34
34
|
key: 0,
|
|
@@ -53,20 +53,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
53
53
|
const regex = new RegExp(`^${octet}\\.${octet}\\.${octet}\\.${octet}$`);
|
|
54
54
|
return regex.test(str);
|
|
55
55
|
}
|
|
56
|
+
function isValidFQDN(str) {
|
|
57
|
+
const fqdnRegex = new RegExp("^(?=.{1,253}$)(?!-)(?:[a-zA-Z0-9-]{1,63}(?<!-)\\.)+[a-zA-Z]{2,}$");
|
|
58
|
+
return fqdnRegex.test(str);
|
|
59
|
+
}
|
|
56
60
|
const tenants = ref([]);
|
|
57
61
|
const model = ref(false);
|
|
58
62
|
const pairStatus = ref(spi._currentStatus);
|
|
59
63
|
const isPaired = computed(() => {
|
|
60
64
|
return [SpiStatus.PairedConnected, SpiStatus.PairedConnecting].includes(pairStatus.value);
|
|
61
65
|
});
|
|
66
|
+
const selectedTenant = ref("");
|
|
62
67
|
const pairForm = ref({
|
|
63
68
|
posId: "",
|
|
64
69
|
serialNumber: "",
|
|
65
70
|
tenantCode: "",
|
|
66
|
-
eftposAddress: "",
|
|
67
71
|
testMode: false,
|
|
68
72
|
autoAddressResolution: false,
|
|
69
|
-
...getPairingData()
|
|
73
|
+
...getPairingData(),
|
|
74
|
+
eftposAddress: localStorage.getItem("eftposAddress") ?? ""
|
|
70
75
|
});
|
|
71
76
|
const pairInfo = ref({
|
|
72
77
|
state: "INPROGRESS",
|
|
@@ -114,6 +119,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
114
119
|
return;
|
|
115
120
|
}
|
|
116
121
|
});
|
|
122
|
+
watch(selectedTenant, (val) => {
|
|
123
|
+
pairForm.value.tenantCode = val === "other" ? "" : val;
|
|
124
|
+
});
|
|
117
125
|
return (_ctx, _cache) => {
|
|
118
126
|
const _directive_close_popup = resolveDirective("close-popup");
|
|
119
127
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
@@ -122,7 +130,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
122
130
|
class: "space-y-4"
|
|
123
131
|
}, {
|
|
124
132
|
default: withCtx(() => [
|
|
125
|
-
_cache[
|
|
133
|
+
_cache[11] || (_cache[11] = createElementVNode("div", { class: "font-sans text-lg font-semibold text-gray-600" }, "MX 51 - SPI Terminal Pairing", -1)),
|
|
126
134
|
createVNode(unref(QSelect), {
|
|
127
135
|
disable: isPaired.value,
|
|
128
136
|
dense: "",
|
|
@@ -171,7 +179,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
171
179
|
label: "Eftpos Address",
|
|
172
180
|
rules: [
|
|
173
181
|
(v) => !!v || "Eftpos Address is required",
|
|
174
|
-
(v) => isValidIP(v) || "The Eftpos address is not in the right format"
|
|
182
|
+
(v) => isValidIP(v) || isValidFQDN(v) || "The Eftpos address is not in the right format"
|
|
175
183
|
],
|
|
176
184
|
hint: "Enter the Eftpos Address associated with the terminal"
|
|
177
185
|
}, null, 8, ["disable", "modelValue", "rules"]),
|
|
@@ -184,29 +192,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
184
192
|
dense: ""
|
|
185
193
|
}, null, 8, ["modelValue", "disable"])
|
|
186
194
|
]),
|
|
195
|
+
createVNode(unref(QCheckbox), {
|
|
196
|
+
disable: isPaired.value,
|
|
197
|
+
dense: "",
|
|
198
|
+
label: "Auto Address Mode",
|
|
199
|
+
modelValue: pairForm.value.autoAddressResolution,
|
|
200
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => pairForm.value.autoAddressResolution = $event)
|
|
201
|
+
}, null, 8, ["disable", "modelValue"]),
|
|
187
202
|
createElementVNode("div", _hoisted_2$1, [
|
|
188
|
-
_cache[
|
|
203
|
+
_cache[10] || (_cache[10] = createElementVNode("div", { class: "text-sm font-medium text-gray-500" }, "Pairing Status", -1)),
|
|
189
204
|
pairStatus.value === unref(SpiStatus).PairedConnected ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
190
205
|
createVNode(unref(QIcon), {
|
|
191
206
|
name: "check_circle",
|
|
192
207
|
size: "xs",
|
|
193
208
|
color: "green"
|
|
194
209
|
}),
|
|
195
|
-
_cache[
|
|
210
|
+
_cache[7] || (_cache[7] = createElementVNode("div", null, "Paired and Connected", -1))
|
|
196
211
|
])) : pairStatus.value === unref(SpiStatus).Unpaired ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
197
212
|
createVNode(unref(QIcon), {
|
|
198
213
|
name: "cancel",
|
|
199
214
|
size: "xs",
|
|
200
215
|
color: "red"
|
|
201
216
|
}),
|
|
202
|
-
_cache[
|
|
217
|
+
_cache[8] || (_cache[8] = createElementVNode("div", null, "Unpaired", -1))
|
|
203
218
|
])) : pairStatus.value === unref(SpiStatus).PairedConnecting ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
204
219
|
createVNode(unref(QIcon), {
|
|
205
220
|
name: "check_circle",
|
|
206
221
|
size: "xs",
|
|
207
222
|
color: "yellow-8"
|
|
208
223
|
}),
|
|
209
|
-
_cache[
|
|
224
|
+
_cache[9] || (_cache[9] = createElementVNode("div", null, "Paired and trying to connect", -1))
|
|
210
225
|
])) : createCommentVNode("", true)
|
|
211
226
|
]),
|
|
212
227
|
!isPaired.value ? (openBlock(), createBlock(unref(QBtn), {
|
|
@@ -235,7 +250,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
235
250
|
}),
|
|
236
251
|
createVNode(unref(QDialog), {
|
|
237
252
|
modelValue: model.value,
|
|
238
|
-
"onUpdate:modelValue": _cache[
|
|
253
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => model.value = $event),
|
|
239
254
|
persistent: ""
|
|
240
255
|
}, {
|
|
241
256
|
default: withCtx(() => [
|
|
@@ -258,9 +273,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
258
273
|
_: 1
|
|
259
274
|
})) : pairInfo.value.state === "CONFIRMATION" ? (openBlock(), createBlock(unref(QCardSection), { key: 1 }, {
|
|
260
275
|
default: withCtx(() => [
|
|
261
|
-
_cache[
|
|
276
|
+
_cache[12] || (_cache[12] = createElementVNode("div", { class: "text-center font-semibold text-gray-500 uppercase" }, "Confirm your pairing code", -1)),
|
|
262
277
|
createElementVNode("div", _hoisted_7$1, toDisplayString(pairInfo.value.confirmationCode), 1),
|
|
263
|
-
_cache[
|
|
278
|
+
_cache[13] || (_cache[13] = createElementVNode("div", { class: "text-center text-sm text-gray-500" }, "Confirm the matching pairing code on the terminal", -1))
|
|
264
279
|
]),
|
|
265
280
|
_: 1
|
|
266
281
|
})) : pairInfo.value.state === "FINISHED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
|