@achyutlabsau/vue-payment-gateway 0.2.9 → 0.2.11
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-BWbN5627.js → event-DqmWpDvf.js} +19 -4
- package/dist/index.js +1 -1
- package/dist/mx51.d.ts +1 -1
- package/dist/mx51.js +294 -184
- package/package.json +1 -1
|
@@ -37,16 +37,31 @@ const pairingData = getPairingData();
|
|
|
37
37
|
const spi = new Spi(
|
|
38
38
|
pairingData.posId ?? "",
|
|
39
39
|
pairingData.serialNumber ?? "",
|
|
40
|
-
localStorage.getItem("eftposAddress") ?? "
|
|
40
|
+
localStorage.getItem("eftposAddress") ?? "",
|
|
41
41
|
getSecrets()
|
|
42
42
|
);
|
|
43
|
-
spi.SetAutoAddressResolution(!!pairingData.autoAddressResolution);
|
|
44
43
|
spi.SetTenantCode(pairingData.tenantCode ?? "gko");
|
|
45
44
|
spi.SetSecureWebSockets(spiSettings.secureWebSockets);
|
|
46
45
|
spi.Config.PrintMerchantCopy = spiSettings.printMerchantCopyOnEftpos;
|
|
47
46
|
spi.Config.PromptForCustomerCopyOnEftpos = spiSettings.promptForCustomerCopyOnEftpos;
|
|
48
47
|
spi.Config.SignatureFlowOnEftpos = spiSettings.signatureFlowOnEftpos;
|
|
49
48
|
const receiptOptions = new TransactionOptions();
|
|
49
|
+
const spiEvents = {
|
|
50
|
+
spiAutoAddressResolutionFailed: "AutoAddressResolutionFailed",
|
|
51
|
+
spiBatteryLevelChanged: "BatteryLevelChanged",
|
|
52
|
+
spiDeviceAddressChanged: "DeviceAddressChanged",
|
|
53
|
+
spiSecretsChanged: "SecretsChanged",
|
|
54
|
+
spiFlowChanged: "spiFlowChanged",
|
|
55
|
+
spiPairingFlowStateChanged: "PairingFlowStateChanged",
|
|
56
|
+
spiPong: "SpiPong",
|
|
57
|
+
spiStatusChanged: "StatusChanged",
|
|
58
|
+
spiTerminalSetupsChanged: "TerminalConfigChanged",
|
|
59
|
+
spiTerminalStatusChanged: "TerminalStatusChanged",
|
|
60
|
+
spiTxFlowStateChanged: "TxFlowStateChanged",
|
|
61
|
+
spiTxUpdateMessage: "TransactionUpdateMessage",
|
|
62
|
+
spiCancelTransactionResponse: "cancel_response",
|
|
63
|
+
TerminalStatusResponse: "terminal_status"
|
|
64
|
+
};
|
|
50
65
|
function log(message, event) {
|
|
51
66
|
if (event) {
|
|
52
67
|
spi._log.info(`${message} -> `, event);
|
|
@@ -64,7 +79,7 @@ document.addEventListener("SecretsChanged", (e) => {
|
|
|
64
79
|
window.localStorage.setItem("secrets", JSON.stringify(e.detail));
|
|
65
80
|
}
|
|
66
81
|
});
|
|
67
|
-
document.addEventListener(
|
|
82
|
+
document.addEventListener(spiEvents.spiPairingFlowStateChanged, (e) => {
|
|
68
83
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
69
84
|
log("Pairing flow state changed", e);
|
|
70
85
|
log(
|
|
@@ -74,7 +89,7 @@ document.addEventListener("PairingFlowStateChanged", (e) => {
|
|
|
74
89
|
spi.AckFlowEndedAndBackToIdle();
|
|
75
90
|
}
|
|
76
91
|
});
|
|
77
|
-
document.addEventListener(
|
|
92
|
+
document.addEventListener(spiEvents.spiTxFlowStateChanged, (e) => {
|
|
78
93
|
log("Transaction flow state changed", e);
|
|
79
94
|
if (e.detail.AwaitingSignatureCheck) ;
|
|
80
95
|
else if (e.detail.AwaitingPhoneForAuth) ;
|
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-DqmWpDvf.js";
|
|
6
6
|
import "vue";
|
|
7
7
|
import "@mx51/spi-client-js";
|
|
8
8
|
import "uuid";
|
package/dist/mx51.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare function getTransaction(posRefId?: string): void;
|
|
|
30
30
|
|
|
31
31
|
export declare function log(message: string, event?: any): void;
|
|
32
32
|
|
|
33
|
-
export declare const PairMX51: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {},
|
|
33
|
+
export declare const PairMX51: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Initiates a purchase transaction
|
package/dist/mx51.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
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, watch, resolveDirective, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, createBlock, toDisplayString, withDirectives } from "vue";
|
|
3
|
-
import { QForm, QSelect, QInput, QCheckbox, QIcon, QBtn, QDialog,
|
|
1
|
+
import { l as log, s as spi, g as getPairingData, a as getTenants, r as receiptOptions } from "./event-DqmWpDvf.js";
|
|
2
|
+
import { defineComponent, ref, computed, onMounted, watch, resolveDirective, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, createBlock, toDisplayString, withDirectives, createTextVNode } from "vue";
|
|
3
|
+
import { QCard, QForm, QSelect, QInput, QCheckbox, QIcon, QBtn, QDialog, QCardSection, Dialog } from "quasar";
|
|
4
4
|
import { useEventListener, useLocalStorage } from "@vueuse/core";
|
|
5
5
|
import { SpiStatus, SuccessState, TransactionType } from "@mx51/spi-client-js";
|
|
6
6
|
import { b as state } from "./state-D014QcxX.js";
|
|
7
7
|
import { v4 } from "uuid";
|
|
8
|
-
function pair(pairingInput) {
|
|
8
|
+
async function pair(pairingInput) {
|
|
9
9
|
spi.SetTenantCode(pairingInput.tenantCode);
|
|
10
10
|
spi.SetEftposAddress(pairingInput.eftposAddress);
|
|
11
11
|
spi.SetSerialNumber(pairingInput.serialNumber);
|
|
12
12
|
spi.SetPosId(pairingInput.posId);
|
|
13
13
|
spi.SetAutoAddressResolution(pairingInput.autoAddressResolution);
|
|
14
14
|
spi.SetTestMode(pairingInput.testMode);
|
|
15
|
+
if (pairingInput.autoAddressResolution) {
|
|
16
|
+
const res = await spi.GetTerminalAddress();
|
|
17
|
+
if (!res) return false;
|
|
18
|
+
}
|
|
15
19
|
log("Pairing...");
|
|
16
|
-
spi.Pair();
|
|
20
|
+
return spi.Pair();
|
|
17
21
|
}
|
|
18
22
|
function unpair() {
|
|
19
23
|
if (!spi) return;
|
|
@@ -28,23 +32,24 @@ function cancelPairing() {
|
|
|
28
32
|
log("Pairing cancelled");
|
|
29
33
|
spi.PairingCancel();
|
|
30
34
|
}
|
|
31
|
-
const _hoisted_1$1 = { class: "my-6 w-full max-w-
|
|
32
|
-
const _hoisted_2$1 = { class: "
|
|
33
|
-
const _hoisted_3$1 = {
|
|
35
|
+
const _hoisted_1$1 = { class: "my-6 flex w-full max-w-5xl flex-row flex-nowrap justify-between gap-6" };
|
|
36
|
+
const _hoisted_2$1 = { class: "mb-0 grid grid-cols-2 gap-x-3" };
|
|
37
|
+
const _hoisted_3$1 = { class: "rounded bg-gray-100 p-3" };
|
|
38
|
+
const _hoisted_4$1 = {
|
|
34
39
|
key: 0,
|
|
35
40
|
class: "flex items-center gap-1 font-semibold"
|
|
36
41
|
};
|
|
37
|
-
const
|
|
42
|
+
const _hoisted_5$1 = {
|
|
38
43
|
key: 1,
|
|
39
44
|
class: "flex items-center gap-1 font-semibold"
|
|
40
45
|
};
|
|
41
|
-
const
|
|
46
|
+
const _hoisted_6$1 = {
|
|
42
47
|
key: 2,
|
|
43
48
|
class: "flex items-center gap-1 font-semibold"
|
|
44
49
|
};
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
50
|
+
const _hoisted_7$1 = { class: "text-center font-semibold text-gray-500 uppercase" };
|
|
51
|
+
const _hoisted_8 = { class: "py-3 text-center text-2xl font-semibold text-slate-700 uppercase" };
|
|
52
|
+
const _hoisted_9 = { class: "text-center font-semibold text-gray-500 uppercase" };
|
|
48
53
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
49
54
|
__name: "PairMX51",
|
|
50
55
|
setup(__props) {
|
|
@@ -57,9 +62,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
57
62
|
const fqdnRegex = new RegExp("^(?=.{1,253}$)(?!-)(?:[a-zA-Z0-9-]{1,63}(?<!-)\\.)+[a-zA-Z]{2,}$");
|
|
58
63
|
return fqdnRegex.test(str);
|
|
59
64
|
}
|
|
65
|
+
function isAlphanumeric(str) {
|
|
66
|
+
const alphanumericRegex = /^[a-zA-Z0-9]+$/;
|
|
67
|
+
return alphanumericRegex.test(str);
|
|
68
|
+
}
|
|
60
69
|
const tenants = ref([]);
|
|
61
70
|
const model = ref(false);
|
|
62
|
-
const pairStatus = ref(spi._currentStatus);
|
|
71
|
+
const pairStatus = ref(spi._currentStatus ?? SpiStatus.Unpaired);
|
|
63
72
|
const isPaired = computed(() => {
|
|
64
73
|
return [SpiStatus.PairedConnected, SpiStatus.PairedConnecting].includes(pairStatus.value);
|
|
65
74
|
});
|
|
@@ -69,20 +78,40 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
69
78
|
serialNumber: "",
|
|
70
79
|
tenantCode: "",
|
|
71
80
|
testMode: false,
|
|
72
|
-
autoAddressResolution:
|
|
81
|
+
autoAddressResolution: true,
|
|
73
82
|
...getPairingData(),
|
|
74
83
|
eftposAddress: localStorage.getItem("eftposAddress") ?? ""
|
|
75
84
|
});
|
|
76
85
|
const pairInfo = ref({
|
|
77
86
|
state: "INPROGRESS",
|
|
78
|
-
message: "Connecting
|
|
87
|
+
message: "Connecting...",
|
|
79
88
|
confirmationCode: ""
|
|
80
89
|
});
|
|
81
|
-
const
|
|
82
|
-
|
|
90
|
+
const isOtherTenantSelected = computed(() => selectedTenant.value === "other");
|
|
91
|
+
const resetPairForm = () => {
|
|
92
|
+
localStorage.removeItem("pairingData");
|
|
93
|
+
localStorage.removeItem("eftposAddress");
|
|
94
|
+
pairForm.value = {
|
|
95
|
+
posId: "",
|
|
96
|
+
serialNumber: "",
|
|
97
|
+
tenantCode: "",
|
|
98
|
+
testMode: false,
|
|
99
|
+
autoAddressResolution: true,
|
|
100
|
+
...getPairingData(),
|
|
101
|
+
eftposAddress: localStorage.getItem("eftposAddress") ?? ""
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const onPairTerminal = async () => {
|
|
105
|
+
model.value = true;
|
|
106
|
+
const isPairingStarted = await pair(pairForm.value);
|
|
107
|
+
if (!isPairingStarted) {
|
|
108
|
+
pairInfo.value.state = "FINISHED";
|
|
109
|
+
pairInfo.value.message = "Sorry, we were unable to pair with the EFTPOS terminal. Please check the Serial Number and Payment Provider have been entered correctly and try again.";
|
|
110
|
+
}
|
|
83
111
|
};
|
|
84
112
|
const onUnpairTerminal = () => {
|
|
85
113
|
unpair();
|
|
114
|
+
resetPairForm();
|
|
86
115
|
Dialog.create({
|
|
87
116
|
title: "Successfully Unpaired!",
|
|
88
117
|
message: "Unpair the terminal from the device menu if it remains paired."
|
|
@@ -92,6 +121,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
92
121
|
const res = await getTenants(state.productVendorName, state.mx51DeviceApiKey);
|
|
93
122
|
if (res) {
|
|
94
123
|
tenants.value = res;
|
|
124
|
+
tenants.value.push({
|
|
125
|
+
code: "other",
|
|
126
|
+
name: "Other Bank"
|
|
127
|
+
});
|
|
128
|
+
const mappedTenants = tenants.value.map((v) => v.code);
|
|
129
|
+
if (pairForm.value.tenantCode) {
|
|
130
|
+
selectedTenant.value = mappedTenants.includes(pairForm.value.tenantCode) ? pairForm.value.tenantCode : "other";
|
|
131
|
+
}
|
|
95
132
|
}
|
|
96
133
|
});
|
|
97
134
|
useEventListener(document, "StatusChanged", (e) => {
|
|
@@ -120,187 +157,260 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
120
157
|
}
|
|
121
158
|
});
|
|
122
159
|
watch(selectedTenant, (val) => {
|
|
123
|
-
|
|
160
|
+
if (val && val !== "other") {
|
|
161
|
+
pairForm.value.tenantCode = val;
|
|
162
|
+
}
|
|
124
163
|
});
|
|
164
|
+
useEventListener(document, "DeviceAddressChanged", (e) => {
|
|
165
|
+
if (e == null ? void 0 : e.detail.ip) {
|
|
166
|
+
pairForm.value.eftposAddress = e.detail.ip;
|
|
167
|
+
} else if (e == null ? void 0 : e.detail.fqdn) {
|
|
168
|
+
pairForm.value.eftposAddress = e.detail.fqdn;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
setInterval(() => pairStatus.value = spi._currentStatus ?? SpiStatus.Unpaired, 1e3);
|
|
125
172
|
return (_ctx, _cache) => {
|
|
126
173
|
const _directive_close_popup = resolveDirective("close-popup");
|
|
127
|
-
return openBlock(), createElementBlock("
|
|
128
|
-
createVNode(unref(
|
|
129
|
-
|
|
130
|
-
|
|
174
|
+
return openBlock(), createElementBlock("section", _hoisted_1$1, [
|
|
175
|
+
createVNode(unref(QCard), {
|
|
176
|
+
flat: "",
|
|
177
|
+
bordered: "",
|
|
178
|
+
class: "flex-grow rounded-md p-6"
|
|
131
179
|
}, {
|
|
132
180
|
default: withCtx(() => [
|
|
133
|
-
_cache[
|
|
134
|
-
createVNode(unref(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
181
|
+
_cache[14] || (_cache[14] = createElementVNode("div", { class: "text-lg font-semibold text-gray-600" }, "Pairing configuration", -1)),
|
|
182
|
+
createVNode(unref(QForm), {
|
|
183
|
+
onSubmit: onPairTerminal,
|
|
184
|
+
class: "space-y-4"
|
|
185
|
+
}, {
|
|
186
|
+
default: withCtx(() => [
|
|
187
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
188
|
+
createVNode(unref(QSelect), {
|
|
189
|
+
"no-error-icon": "",
|
|
190
|
+
disable: isPaired.value,
|
|
191
|
+
dense: "",
|
|
192
|
+
class: "my-6",
|
|
193
|
+
outlined: "",
|
|
194
|
+
label: "Payment Provider",
|
|
195
|
+
modelValue: selectedTenant.value,
|
|
196
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedTenant.value = $event),
|
|
197
|
+
options: tenants.value,
|
|
198
|
+
"map-options": "",
|
|
199
|
+
"option-value": "code",
|
|
200
|
+
"option-label": "name",
|
|
201
|
+
"emit-value": "",
|
|
202
|
+
rules: [(v) => !!v || "Please select Payment Provider"]
|
|
203
|
+
}, null, 8, ["disable", "modelValue", "options", "rules"]),
|
|
204
|
+
createVNode(unref(QInput), {
|
|
205
|
+
"no-error-icon": "",
|
|
206
|
+
disable: isPaired.value || !isOtherTenantSelected.value,
|
|
207
|
+
dense: "",
|
|
208
|
+
class: "my-6",
|
|
209
|
+
outlined: "",
|
|
210
|
+
label: "Other (Please specify)",
|
|
211
|
+
modelValue: pairForm.value.tenantCode,
|
|
212
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => pairForm.value.tenantCode = $event),
|
|
213
|
+
"map-options": "",
|
|
214
|
+
"option-value": "code",
|
|
215
|
+
"option-label": "name",
|
|
216
|
+
"emit-value": "",
|
|
217
|
+
rules: [
|
|
218
|
+
(v) => !!v && v.length < 10 || "Please enter a supported provider less than 10 characters",
|
|
219
|
+
(v) => isAlphanumeric(v) || "Tenant must contain only alphanumeric characters"
|
|
220
|
+
]
|
|
221
|
+
}, null, 8, ["disable", "modelValue", "rules"])
|
|
222
|
+
]),
|
|
223
|
+
createVNode(unref(QInput), {
|
|
224
|
+
"no-error-icon": "",
|
|
225
|
+
disable: isPaired.value,
|
|
226
|
+
dense: "",
|
|
227
|
+
outlined: "",
|
|
228
|
+
modelValue: pairForm.value.posId,
|
|
229
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pairForm.value.posId = $event),
|
|
230
|
+
label: "POS ID",
|
|
231
|
+
rules: [
|
|
232
|
+
(v) => !!v || "POS ID is required",
|
|
233
|
+
(val) => isAlphanumeric(val) || "Pos ID must contain only alphanumeric characters",
|
|
234
|
+
(val) => val && val.length <= 16 || "POS ID must be less than 16 characters"
|
|
235
|
+
]
|
|
236
|
+
}, null, 8, ["disable", "modelValue", "rules"]),
|
|
237
|
+
createVNode(unref(QInput), {
|
|
238
|
+
"no-error-icon": "",
|
|
239
|
+
disable: isPaired.value,
|
|
240
|
+
dense: "",
|
|
241
|
+
outlined: "",
|
|
242
|
+
modelValue: pairForm.value.serialNumber,
|
|
243
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => pairForm.value.serialNumber = $event),
|
|
244
|
+
label: "Serial Number",
|
|
245
|
+
rules: [(v) => !!v || "Serial Number is required"],
|
|
246
|
+
hint: "Enter the Serial Number associated with the terminal"
|
|
247
|
+
}, null, 8, ["disable", "modelValue", "rules"]),
|
|
248
|
+
createVNode(unref(QInput), {
|
|
249
|
+
"no-error-icon": "",
|
|
250
|
+
disable: isPaired.value || pairForm.value.autoAddressResolution,
|
|
251
|
+
dense: "",
|
|
252
|
+
outlined: "",
|
|
253
|
+
modelValue: pairForm.value.eftposAddress,
|
|
254
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => pairForm.value.eftposAddress = $event),
|
|
255
|
+
label: "Eftpos Address",
|
|
256
|
+
rules: [
|
|
257
|
+
(v) => !!v || "Eftpos Address is required",
|
|
258
|
+
(v) => isValidIP(v) || isValidFQDN(v) || "The Eftpos address is not in the right format"
|
|
259
|
+
],
|
|
260
|
+
hint: "Enter the Eftpos Address associated with the terminal"
|
|
261
|
+
}, null, 8, ["disable", "modelValue", "rules"]),
|
|
262
|
+
createElementVNode("div", null, [
|
|
263
|
+
createVNode(unref(QCheckbox), {
|
|
264
|
+
label: "Test Mode",
|
|
265
|
+
modelValue: pairForm.value.testMode,
|
|
266
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => pairForm.value.testMode = $event),
|
|
267
|
+
disable: isPaired.value,
|
|
268
|
+
dense: ""
|
|
269
|
+
}, null, 8, ["modelValue", "disable"])
|
|
270
|
+
]),
|
|
271
|
+
createVNode(unref(QCheckbox), {
|
|
272
|
+
disable: isPaired.value,
|
|
273
|
+
dense: "",
|
|
274
|
+
label: "Auto Address Mode",
|
|
275
|
+
modelValue: pairForm.value.autoAddressResolution,
|
|
276
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => pairForm.value.autoAddressResolution = $event)
|
|
277
|
+
}, null, 8, ["disable", "modelValue"]),
|
|
278
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
279
|
+
_cache[11] || (_cache[11] = createElementVNode("div", { class: "text-sm font-medium text-gray-500" }, "Pairing Status", -1)),
|
|
280
|
+
pairStatus.value === unref(SpiStatus).PairedConnected ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
281
|
+
createVNode(unref(QIcon), {
|
|
282
|
+
name: "check_circle",
|
|
283
|
+
size: "xs",
|
|
284
|
+
color: "green"
|
|
285
|
+
}),
|
|
286
|
+
_cache[8] || (_cache[8] = createElementVNode("div", null, "Paired and Connected", -1))
|
|
287
|
+
])) : pairStatus.value === unref(SpiStatus).Unpaired ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
288
|
+
createVNode(unref(QIcon), {
|
|
289
|
+
name: "cancel",
|
|
290
|
+
size: "xs",
|
|
291
|
+
color: "red"
|
|
292
|
+
}),
|
|
293
|
+
_cache[9] || (_cache[9] = createElementVNode("div", null, "Unpaired", -1))
|
|
294
|
+
])) : pairStatus.value === unref(SpiStatus).PairedConnecting ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
|
|
295
|
+
createVNode(unref(QIcon), {
|
|
296
|
+
name: "check_circle",
|
|
297
|
+
size: "xs",
|
|
298
|
+
color: "yellow-8"
|
|
299
|
+
}),
|
|
300
|
+
_cache[10] || (_cache[10] = createElementVNode("div", null, "Paired and trying to connect", -1))
|
|
301
|
+
])) : createCommentVNode("", true)
|
|
302
|
+
]),
|
|
303
|
+
!isPaired.value ? (openBlock(), createBlock(unref(QBtn), {
|
|
304
|
+
key: 0,
|
|
305
|
+
label: "Pair",
|
|
306
|
+
type: "submit",
|
|
307
|
+
color: "primary",
|
|
308
|
+
class: "!w-full",
|
|
309
|
+
unelevated: "",
|
|
310
|
+
"no-caps": "",
|
|
311
|
+
ripple: false
|
|
312
|
+
})) : (openBlock(), createBlock(unref(QBtn), {
|
|
313
|
+
key: 1,
|
|
314
|
+
label: "Unpair",
|
|
315
|
+
type: "button",
|
|
316
|
+
color: "primary",
|
|
317
|
+
class: "!w-full",
|
|
318
|
+
unelevated: "",
|
|
319
|
+
"no-caps": "",
|
|
320
|
+
onClick: onUnpairTerminal,
|
|
321
|
+
outline: "",
|
|
322
|
+
ripple: false
|
|
323
|
+
}))
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
}),
|
|
327
|
+
createVNode(unref(QDialog), {
|
|
328
|
+
modelValue: model.value,
|
|
329
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => model.value = $event),
|
|
330
|
+
persistent: ""
|
|
331
|
+
}, {
|
|
332
|
+
default: withCtx(() => [
|
|
333
|
+
createVNode(unref(QCard), { class: "w-full p-3" }, {
|
|
334
|
+
default: withCtx(() => [
|
|
335
|
+
pairInfo.value.state === "INPROGRESS" ? (openBlock(), createBlock(unref(QCardSection), { key: 0 }, {
|
|
336
|
+
default: withCtx(() => [
|
|
337
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(pairInfo.value.message), 1),
|
|
338
|
+
createVNode(unref(QBtn), {
|
|
339
|
+
label: "Cancel",
|
|
340
|
+
onClick: unref(cancelPairing),
|
|
341
|
+
color: "primary",
|
|
342
|
+
outline: "",
|
|
343
|
+
class: "!mt-6 !w-full",
|
|
344
|
+
unelevated: "",
|
|
345
|
+
"no-caps": "",
|
|
346
|
+
ripple: false
|
|
347
|
+
}, null, 8, ["onClick"])
|
|
348
|
+
]),
|
|
349
|
+
_: 1
|
|
350
|
+
})) : pairInfo.value.state === "CONFIRMATION" ? (openBlock(), createBlock(unref(QCardSection), { key: 1 }, {
|
|
351
|
+
default: withCtx(() => [
|
|
352
|
+
_cache[12] || (_cache[12] = createElementVNode("div", { class: "text-center font-semibold text-gray-500 uppercase" }, "Confirm your pairing code", -1)),
|
|
353
|
+
createElementVNode("div", _hoisted_8, toDisplayString(pairInfo.value.confirmationCode), 1),
|
|
354
|
+
_cache[13] || (_cache[13] = createElementVNode("div", { class: "text-center text-sm text-gray-500" }, "Confirm the matching pairing code on the terminal", -1))
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
})) : pairInfo.value.state === "FINISHED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
|
|
358
|
+
default: withCtx(() => [
|
|
359
|
+
createElementVNode("div", _hoisted_9, toDisplayString(pairInfo.value.message), 1),
|
|
360
|
+
withDirectives(createVNode(unref(QBtn), {
|
|
361
|
+
label: "OK",
|
|
362
|
+
color: "primary",
|
|
363
|
+
outline: "",
|
|
364
|
+
class: "!mt-6 !w-full",
|
|
365
|
+
unelevated: "",
|
|
366
|
+
"no-caps": "",
|
|
367
|
+
ripple: false
|
|
368
|
+
}, null, 512), [
|
|
369
|
+
[_directive_close_popup]
|
|
370
|
+
])
|
|
371
|
+
]),
|
|
372
|
+
_: 1
|
|
373
|
+
})) : createCommentVNode("", true)
|
|
374
|
+
]),
|
|
375
|
+
_: 1
|
|
376
|
+
})
|
|
377
|
+
]),
|
|
378
|
+
_: 1
|
|
379
|
+
}, 8, ["modelValue"])
|
|
248
380
|
]),
|
|
249
381
|
_: 1
|
|
250
382
|
}),
|
|
251
|
-
createVNode(unref(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
383
|
+
createVNode(unref(QCard), {
|
|
384
|
+
class: "h-fit max-w-sm",
|
|
385
|
+
flat: "",
|
|
386
|
+
bordered: ""
|
|
255
387
|
}, {
|
|
256
388
|
default: withCtx(() => [
|
|
257
|
-
createVNode(unref(
|
|
258
|
-
default: withCtx(() => [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}, null, 8, ["onClick"])
|
|
389
|
+
createVNode(unref(QCardSection), null, {
|
|
390
|
+
default: withCtx(() => _cache[15] || (_cache[15] = [
|
|
391
|
+
createElementVNode("div", { class: "text-xl" }, [
|
|
392
|
+
createTextVNode(" Steps to pair for: "),
|
|
393
|
+
createElementVNode("br"),
|
|
394
|
+
createElementVNode("b", null, "Simple Payments Integration")
|
|
395
|
+
], -1),
|
|
396
|
+
createElementVNode("ul", { class: "mt-3 list-inside list-decimal space-y-2 text-base" }, [
|
|
397
|
+
createElementVNode("li", null, "Select your payment provider."),
|
|
398
|
+
createElementVNode("li", null, "On the terminal: Go to “Manage POS pairing” to create a new POS Pairing."),
|
|
399
|
+
createElementVNode("li", null, [
|
|
400
|
+
createTextVNode("On the terminal: Select "),
|
|
401
|
+
createElementVNode("b", null, "“Simple Payments Integration”"),
|
|
402
|
+
createTextVNode(".")
|
|
272
403
|
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
_cache[13] || (_cache[13] = createElementVNode("div", { class: "text-center text-sm text-gray-500" }, "Confirm the matching pairing code on the terminal", -1))
|
|
279
|
-
]),
|
|
280
|
-
_: 1
|
|
281
|
-
})) : pairInfo.value.state === "FINISHED" ? (openBlock(), createBlock(unref(QCardSection), { key: 2 }, {
|
|
282
|
-
default: withCtx(() => [
|
|
283
|
-
createElementVNode("div", _hoisted_8, toDisplayString(pairInfo.value.message), 1),
|
|
284
|
-
withDirectives(createVNode(unref(QBtn), {
|
|
285
|
-
label: "OK",
|
|
286
|
-
color: "primary",
|
|
287
|
-
outline: "",
|
|
288
|
-
class: "!mt-6 !w-full",
|
|
289
|
-
unelevated: "",
|
|
290
|
-
"no-caps": "",
|
|
291
|
-
ripple: false
|
|
292
|
-
}, null, 512), [
|
|
293
|
-
[_directive_close_popup]
|
|
294
|
-
])
|
|
295
|
-
]),
|
|
296
|
-
_: 1
|
|
297
|
-
})) : createCommentVNode("", true)
|
|
298
|
-
]),
|
|
404
|
+
createElementVNode("li", null, "Enter the serial number and IP address provided from the terminal."),
|
|
405
|
+
createElementVNode("li", null, "Create a POS ID to identify the pairing connection."),
|
|
406
|
+
createElementVNode("li", null, "Tap “Pair” to initiate the pairing on both devices.")
|
|
407
|
+
], -1)
|
|
408
|
+
])),
|
|
299
409
|
_: 1
|
|
300
410
|
})
|
|
301
411
|
]),
|
|
302
412
|
_: 1
|
|
303
|
-
}
|
|
413
|
+
})
|
|
304
414
|
]);
|
|
305
415
|
};
|
|
306
416
|
}
|