@achyutlabsau/vue-payment-gateway 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { d as e, f as t, m as n, p as r, s as i } from "./PairInstructions-BxzivULm.js";
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
- import { a as l, i as u, r as d } from "./worldline-CEiMow5_.js";
5
- import { n as f } from "./utils-LqvcWjKL.js";
6
- import { t as p } from "./linkly-CT1cdbii.js";
7
- import { t as m } from "./smartpay-ebnYmikX.js";
8
- import { t as h } from "./till-payment-D4iFCkpk.js";
9
- import { t as g } from "./valpay-DVV1AH4F.js";
4
+ import { a as l, i as u, r as d } from "./worldline-B-YkSPMs.js";
5
+ import { n as f } from "./utils-CAwJtwP_.js";
6
+ import { t as p } from "./linkly-BICvJBrk.js";
7
+ import { t as m } from "./smartpay-BHnbLa5i.js";
8
+ import { t as h } from "./till-payment-BlnycpPt.js";
9
+ import { t as g } from "./valpay-Co5GhIks.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 { i as s, n as c, r as l, t as u } from "./utils-LqvcWjKL.js";
3
- import { t as d } from "./utils-BPFf60Ai.js";
4
- import { t as f } from "./core-BMUVlh-t.js";
5
- import { createBlock as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, onMounted as ee, openBlock as y, ref as b, renderSlot as x, resolveDirective as S, toDisplayString as te, unref as C, useModel as w, withCtx as T, withDirectives as E } from "vue";
6
- import { Dialog as D, Loading as O, Notify as k, QBtn as A, QCard as j, QCardActions as ne, QCardSection as re, QDialog as ie, QForm as ae, QIcon as M, QInput as N, QToolbar as P, QToolbarTitle as F } from "quasar";
7
- import { useLocalStorage as oe } from "@vueuse/core";
2
+ import { a as s, i as c, n as l, o as u, r as d, t as f } from "./utils-CAwJtwP_.js";
3
+ import { t as p } from "./utils-BPFf60Ai.js";
4
+ import { t as m } from "./core-BMUVlh-t.js";
5
+ import { createBlock as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, defineComponent as b, onMounted as ee, openBlock as x, ref as S, renderSlot as C, resolveDirective as te, toDisplayString as ne, unref as w, useModel as re, withCtx as T, withDirectives as E } from "vue";
6
+ import { Dialog as ie, Loading as D, Notify as O, QBtn as k, QCard as A, QCardActions as ae, QCardSection as j, QDialog as M, QForm as N, QIcon as P, QInput as F, QToolbar as oe, QToolbarTitle as se } from "quasar";
7
+ import { useLocalStorage as ce } from "@vueuse/core";
8
8
  import { v7 as I } from "uuid";
9
- import L, { HttpStatusCode as R, isAxiosError as se } from "axios";
9
+ import L, { HttpStatusCode as R, isAxiosError as le } 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, ce = class {
39
+ }, B = { async: !1 }, V = 18e4, H = 2e3, U = 1e3, { PATHS: W, STORAGE_KEYS: G } = z, ue = 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 (se(e)) {
66
+ if (le(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: s(t) && (n = "A server error has occurred. Wait a few seconds and attempt the request again. If the problem persists, contact Linkly Support.");
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
- l(e) && (n = "You are not connected to the internet");
80
+ d(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 || s(n)) return this.getTransactionStatus(t);
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 || s(e)) {
157
- if (t < V) return await u(H), t = Math.min(t + U, V), n();
156
+ if (r === R.RequestTimeout || c(e)) {
157
+ if (t < V) return await f(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 || s(t)) return await u(), this.reprintReceipt(e);
193
+ if (n === R.RequestTimeout || c(t)) return await f(), 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 || s(t)) return await u(), this.sendKey(e);
222
+ if (n === R.RequestTimeout || c(t)) return await f(), 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 ce({
243
+ let e = new ue({
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 = D.create({
251
- ...d,
250
+ let n = ie.create({
251
+ ...p,
252
252
  message: "Pairing with the terminal..."
253
253
  }), r = await e.pairPinpad(t);
254
254
  return n.update({
@@ -261,13 +261,14 @@ var z = {
261
261
  let r = { Request: {
262
262
  Merchant: "00",
263
263
  Application: "00",
264
- TxnRef: c(),
264
+ TxnRef: l(),
265
265
  TxnType: n,
266
266
  CurrencyCode: q.AustralianDollar,
267
267
  CutReceipt: t.CutReceipt,
268
268
  AmtPurchase: t.AmtPurchase,
269
- ReceiptAutoPrint: t.ReceiptAutoPrint
270
- } }, i = f({
269
+ ReceiptAutoPrint: t.ReceiptAutoPrint,
270
+ ...t.referenceNumber ? { PurchaseAnalysisData: { RFN: t.referenceNumber } } : {}
271
+ } }, i = m({
271
272
  message: `${n === K.Purchase ? "Purchase" : "Refund"} of $${t.AmtPurchase / 100} in progress...`,
272
273
  onCancel: () => {
273
274
  i.progress("Trying to cancel transaction..."), e.sendKey(X.Cancel);
@@ -279,26 +280,26 @@ var z = {
279
280
  result: Z.APPROVED,
280
281
  data: t.response,
281
282
  tipAmount: t.response?.amtTip ?? null,
282
- maskedCard: t.response?.pan ?? null,
283
- cardScheme: t.response?.cardType ?? null
283
+ maskedCard: s(t.response?.pan),
284
+ cardScheme: u(t.response?.cardType)
284
285
  }) : t?.response?.responseCode === Y.GENERAL_DECLINE ? (i.failed("Transaction Declined!"), {
285
286
  result: Z.DECLINED,
286
287
  data: t.response,
287
288
  tipAmount: t.response?.amtTip ?? null,
288
- maskedCard: t.response?.pan ?? null,
289
- cardScheme: t.response?.cardType ?? null
289
+ maskedCard: s(t.response?.pan),
290
+ cardScheme: u(t.response?.cardType)
290
291
  }) : t?.response?.responseCode === Y.CANCELLED ? (i.failed("Transaction Cancelled!"), {
291
292
  result: Z.CANCELLED,
292
293
  data: t.response,
293
294
  tipAmount: t.response?.amtTip ?? null,
294
- maskedCard: t.response?.pan ?? null,
295
- cardScheme: t.response?.cardType ?? null
295
+ maskedCard: s(t.response?.pan),
296
+ cardScheme: u(t.response?.cardType)
296
297
  }) : (i.failed("Transaction Failed!"), {
297
298
  result: Z.UNKNOWN,
298
299
  data: t.response,
299
300
  tipAmount: t.response?.amtTip ?? null,
300
- maskedCard: t.response?.pan ?? null,
301
- cardScheme: t.response?.cardType ?? null
301
+ maskedCard: s(t.response?.pan),
302
+ cardScheme: u(t.response?.cardType)
302
303
  });
303
304
  } catch (e) {
304
305
  throw i.failed("Transaction Failed!"), e;
@@ -323,7 +324,7 @@ var z = {
323
324
  getTransactionBySessionId: e.getTransactionStatus,
324
325
  getLastTransaction: e.getLastTransactionStatus
325
326
  };
326
- }, le = { class: "" }, ue = /* @__PURE__ */ v({
327
+ }, de = { class: "" }, fe = /* @__PURE__ */ b({
327
328
  __name: "ReprintReceiptDialog",
328
329
  props: {
329
330
  modelValue: { type: Boolean },
@@ -331,37 +332,37 @@ var z = {
331
332
  },
332
333
  emits: ["update:modelValue"],
333
334
  setup(e) {
334
- let t = Q(), n = w(e, "modelValue"), r = b(""), i = async () => {
335
+ let t = Q(), n = re(e, "modelValue"), r = S(""), i = async () => {
335
336
  try {
336
- O.show({ group: "reprintReceipt" });
337
+ D.show({ group: "reprintReceipt" });
337
338
  let e = await t.reprintReceipt(r.value || void 0);
338
- e.success ? (n.value = !1, k.create("Receipt printed successfully")) : k.create({
339
+ e.success ? (n.value = !1, O.create("Receipt printed successfully")) : O.create({
339
340
  type: "negative",
340
341
  message: e.message
341
342
  });
342
343
  } catch (e) {
343
344
  let t = e instanceof Error ? e.message : "Failed to print receipts";
344
- k.create({
345
+ O.create({
345
346
  type: "negative",
346
347
  message: t
347
348
  });
348
349
  } finally {
349
- O.hide("reprintReceipt");
350
+ D.hide("reprintReceipt");
350
351
  }
351
352
  };
352
353
  return (e, t) => {
353
- let a = S("close-popup");
354
- return y(), p(C(ie), {
354
+ let a = te("close-popup");
355
+ return x(), h(w(M), {
355
356
  modelValue: n.value,
356
357
  "onUpdate:modelValue": t[1] ||= (e) => n.value = e
357
358
  }, {
358
- default: T(() => [_(C(j), { class: "w-full" }, {
359
+ default: T(() => [y(w(A), { class: "w-full" }, {
359
360
  default: T(() => [
360
- _(C(P), { class: "bg-primary text-white" }, {
361
- default: T(() => [_(C(F), null, {
362
- default: T(() => [x(e.$slots, "title", {}, () => [t[2] ||= g("Reprint Receipt", -1)])]),
361
+ y(w(oe), { class: "bg-primary text-white" }, {
362
+ default: T(() => [y(w(se), null, {
363
+ default: T(() => [C(e.$slots, "title", {}, () => [t[2] ||= v("Reprint Receipt", -1)])]),
363
364
  _: 3
364
- }), E(_(C(M), {
365
+ }), E(y(w(P), {
365
366
  class: "float-right cursor-pointer rounded p-2 transition-colors",
366
367
  color: "gray",
367
368
  name: "close",
@@ -369,8 +370,8 @@ var z = {
369
370
  }, null, 512), [[a]])]),
370
371
  _: 3
371
372
  }),
372
- _(C(re), null, {
373
- default: T(() => [h("div", le, [t[3] ||= g(" Txn Number: ", -1), _(C(N), {
373
+ y(w(j), null, {
374
+ default: T(() => [_("div", de, [t[3] ||= v(" Txn Number: ", -1), y(w(F), {
374
375
  modelValue: r.value,
375
376
  "onUpdate:modelValue": t[0] ||= (e) => r.value = e,
376
377
  class: "q-mb-sm",
@@ -381,16 +382,16 @@ var z = {
381
382
  }, null, 8, ["modelValue"])])]),
382
383
  _: 1
383
384
  }),
384
- _(C(ne), {
385
+ y(w(ae), {
385
386
  class: "!p-4",
386
387
  align: "right"
387
388
  }, {
388
- default: T(() => [E(_(C(A), {
389
+ default: T(() => [E(y(w(k), {
389
390
  label: "Cancel",
390
391
  "no-caps": "",
391
392
  unelevated: "",
392
393
  flat: ""
393
- }, null, 512), [[a]]), _(C(A), {
394
+ }, null, 512), [[a]]), y(w(k), {
394
395
  label: "Re-print Receipt",
395
396
  "no-caps": "",
396
397
  unelevated: "",
@@ -406,7 +407,7 @@ var z = {
406
407
  }, 8, ["modelValue"]);
407
408
  };
408
409
  }
409
- }), de = { class: "" }, fe = { class: "text-center" }, pe = { class: "mb-6" }, $ = { class: "mb-6 text-sm text-gray-500 dark:text-gray-300" }, me = { class: "!space-x-3" }, he = { key: 1 }, ge = { class: "flex items-center justify-end gap-3" }, _e = /* @__PURE__ */ v({
410
+ }), pe = { class: "" }, me = { class: "text-center" }, he = { class: "mb-6" }, ge = { class: "mb-6 text-sm text-gray-500 dark:text-gray-300" }, $ = { class: "!space-x-3" }, _e = { key: 1 }, ve = { class: "flex items-center justify-end gap-3" }, ye = /* @__PURE__ */ b({
410
411
  __name: "PairLinkly",
411
412
  emits: ["pairing-success"],
412
413
  setup(t, { emit: o }) {
@@ -415,71 +416,71 @@ var z = {
415
416
  "Set the PIN pad up to connect to the Linkly cloud. Each bank may have different configuration settings.",
416
417
  "Once connected, the PIN pad will display a temporary 'pair code'",
417
418
  "Enter the username, password, and PIN pad 'pair code' from the PIN pad in the form on next screen."
418
- ], c = (e) => [(t) => !!t || `${e} is required`, (t) => t.length <= 16 || `${e} must be less than 16 characters.`], l = o, u = Q(), d = oe("linkly.pairConfig", {
419
+ ], c = (e) => [(t) => !!t || `${e} is required`, (t) => t.length <= 16 || `${e} must be less than 16 characters.`], l = o, u = Q(), d = ce("linkly.pairConfig", {
419
420
  isPaired: !1,
420
421
  lastPairedDate: null
421
- }), f = b(!1), g = b({
422
+ }), f = S(!1), p = S({
422
423
  username: "",
423
424
  password: "",
424
425
  pairCode: ""
425
- }), v = b(!d.value.isPaired), x = () => {
426
- v.value = !1;
427
- }, S = async () => {
428
- let e = await u.pairPinpad(g.value);
426
+ }), m = S(!d.value.isPaired), v = () => {
427
+ m.value = !1;
428
+ }, b = async () => {
429
+ let e = await u.pairPinpad(p.value);
429
430
  e.success && (d.value.isPaired = !0, d.value.lastPairedDate = /* @__PURE__ */ new Date(), l("pairing-success", e));
430
- }, w = () => {
431
+ }, C = () => {
431
432
  u.unpairPinpad(), d.value.isPaired = !1, d.value.lastPairedDate = null;
432
433
  };
433
- return ee(() => {}), (t, o) => (y(), m("div", de, [C(d).isPaired ? (y(), p(C(j), {
434
+ return ee(() => {}), (t, o) => (x(), g("div", pe, [w(d).isPaired ? (x(), h(w(A), {
434
435
  key: "paired",
435
436
  class: "flex items-center justify-center rounded-lg p-8",
436
437
  flat: "",
437
438
  bordered: ""
438
439
  }, {
439
- default: T(() => [h("div", fe, [
440
- h("div", pe, [_(C(M), {
441
- name: C(i),
440
+ default: T(() => [_("div", me, [
441
+ _("div", he, [y(w(P), {
442
+ name: w(i),
442
443
  size: "4rem",
443
444
  class: "text-green-500"
444
445
  }, null, 8, ["name"])]),
445
- o[6] ||= h("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1),
446
- h("p", $, " Last paired: " + te(new Date(C(d).lastPairedDate).toLocaleString()), 1),
447
- h("div", me, [_(C(A), {
446
+ o[6] ||= _("h2", { class: "mb-4 text-3xl font-bold" }, "Terminal Connected", -1),
447
+ _("p", ge, " Last paired: " + ne(new Date(w(d).lastPairedDate).toLocaleString()), 1),
448
+ _("div", $, [y(w(k), {
448
449
  color: "green",
449
450
  "no-caps": "",
450
451
  outline: "",
451
452
  unelevated: "",
452
453
  label: "Reprint Receipt",
453
- "icon-left": C(n),
454
+ "icon-left": w(n),
454
455
  onClick: o[0] ||= (e) => f.value = !0
455
- }, null, 8, ["icon-left"]), _(C(A), {
456
+ }, null, 8, ["icon-left"]), y(w(k), {
456
457
  color: "primary",
457
458
  unelevated: "",
458
459
  "no-caps": "",
459
- "icon-left": C(r),
460
+ "icon-left": w(r),
460
461
  label: "Re-pair Terminal",
461
- onClick: w
462
+ onClick: C
462
463
  }, null, 8, ["icon-left"])])
463
464
  ])]),
464
465
  _: 1
465
- })) : (y(), m("section", he, [v.value ? (y(), p(a, {
466
+ })) : (x(), g("section", _e, [m.value ? (x(), h(a, {
466
467
  key: 0,
467
- onNext: x,
468
+ onNext: v,
468
469
  steps: s
469
- })) : (y(), p(C(j), {
470
+ })) : (x(), h(w(A), {
470
471
  key: 1,
471
472
  flat: "",
472
473
  bordered: "",
473
474
  class: "w-full rounded-md p-6"
474
475
  }, {
475
- default: T(() => [o[7] ||= h("div", { class: "text-lg font-semibold" }, "Pairing configuration", -1), _(C(ae), {
476
- onSubmit: S,
476
+ default: T(() => [o[7] ||= _("div", { class: "text-lg font-semibold" }, "Pairing configuration", -1), y(w(N), {
477
+ onSubmit: b,
477
478
  class: "mt-6 space-y-4"
478
479
  }, {
479
480
  default: T(() => [
480
- _(C(N), {
481
- modelValue: g.value.username,
482
- "onUpdate:modelValue": o[1] ||= (e) => g.value.username = e,
481
+ y(w(F), {
482
+ modelValue: p.value.username,
483
+ "onUpdate:modelValue": o[1] ||= (e) => p.value.username = e,
483
484
  rules: c("Username"),
484
485
  label: "Username",
485
486
  hint: "Cloud EFT Client Username",
@@ -488,9 +489,9 @@ var z = {
488
489
  "no-error-icon": "",
489
490
  dense: ""
490
491
  }, null, 8, ["modelValue", "rules"]),
491
- _(C(N), {
492
- modelValue: g.value.password,
493
- "onUpdate:modelValue": o[2] ||= (e) => g.value.password = e,
492
+ y(w(F), {
493
+ modelValue: p.value.password,
494
+ "onUpdate:modelValue": o[2] ||= (e) => p.value.password = e,
494
495
  rules: c("Password"),
495
496
  label: "Password",
496
497
  "no-error-icon": "",
@@ -499,9 +500,9 @@ var z = {
499
500
  hint: "Enter Cloud EFT Client Password",
500
501
  dense: ""
501
502
  }, null, 8, ["modelValue", "rules"]),
502
- _(C(N), {
503
- modelValue: g.value.pairCode,
504
- "onUpdate:modelValue": o[3] ||= (e) => g.value.pairCode = e,
503
+ y(w(F), {
504
+ modelValue: p.value.pairCode,
505
+ "onUpdate:modelValue": o[3] ||= (e) => p.value.pairCode = e,
505
506
  rules: c("Pairing Code"),
506
507
  label: "Pairing Code",
507
508
  type: "text",
@@ -510,29 +511,29 @@ var z = {
510
511
  hint: "Enter Pair code from terminal screen",
511
512
  dense: ""
512
513
  }, null, 8, ["modelValue", "rules"]),
513
- h("div", ge, [_(C(A), {
514
+ _("div", ve, [y(w(k), {
514
515
  flat: "",
515
516
  "no-caps": "",
516
517
  label: "Back",
517
- "icon-left": C(n),
518
- onClick: o[4] ||= (e) => v.value = !0
519
- }, null, 8, ["icon-left"]), _(C(A), {
518
+ "icon-left": w(n),
519
+ onClick: o[4] ||= (e) => m.value = !0
520
+ }, null, 8, ["icon-left"]), y(w(k), {
520
521
  type: "submit",
521
522
  color: "primary",
522
523
  unelevated: "",
523
524
  "no-caps": "",
524
- "icon-right": C(e),
525
+ "icon-right": w(e),
525
526
  label: "Pair Device"
526
527
  }, null, 8, ["icon-right"])])
527
528
  ]),
528
529
  _: 1
529
530
  })]),
530
531
  _: 1
531
- }))])), _(ue, {
532
+ }))])), y(fe, {
532
533
  modelValue: f.value,
533
534
  "onUpdate:modelValue": o[5] ||= (e) => f.value = e
534
535
  }, null, 8, ["modelValue"])]));
535
536
  }
536
537
  });
537
538
  //#endregion
538
- export { J as a, K as c, X as i, Q as n, Y as o, q as r, Z as s, _e as t };
539
+ export { J as a, K as c, X as i, Q as n, Y as o, q as r, Z as s, ye as t };
package/dist/linkly.d.ts CHANGED
@@ -259,9 +259,14 @@ export declare interface PinpadPairResponse {
259
259
  }
260
260
 
261
261
  declare interface PurchaseAnalysisData {
262
- OPR: string;
263
- AMT: string;
264
- PCM: string;
262
+ OPR?: string;
263
+ AMT?: string;
264
+ PCM?: string;
265
+ /**
266
+ * Reference Number from the purchase request this refund is for. Populate to
267
+ * perform a referenced (linked) refund tied to the original purchase.
268
+ */
269
+ RFN?: string;
265
270
  }
266
271
 
267
272
  export declare enum ReceiptAutoPrint {
@@ -325,7 +330,14 @@ export declare enum TransactionOutcome {
325
330
  UNKNOWN = "UNKNOWN"
326
331
  }
327
332
 
328
- export declare type TransactionPayload = Pick<TransactionPostRequest, "AmtPurchase" | "ReceiptAutoPrint" | "CutReceipt">;
333
+ export declare type TransactionPayload = Pick<TransactionPostRequest, "AmtPurchase" | "ReceiptAutoPrint" | "CutReceipt"> & {
334
+ /**
335
+ * Reference Number (RFN) from the original purchase this refund relates to.
336
+ * When provided on a refund, Linkly performs a referenced (linked) refund by
337
+ * sending it as `PurchaseAnalysisData.RFN`. Ignored for purchases.
338
+ */
339
+ referenceNumber?: string;
340
+ };
329
341
 
330
342
  /**
331
343
  * View Documentation - https://www.linkly.com.au/apidoc/REST/#purchase
@@ -424,8 +436,8 @@ export declare const useLinkly: () => {
424
436
  };
425
437
  };
426
438
  tipAmount: number;
427
- maskedCard: string;
428
- cardScheme: string;
439
+ maskedCard: string | null;
440
+ cardScheme: string | null;
429
441
  }>;
430
442
  initiateRefund: (data: TransactionPayload) => Promise<{
431
443
  result: TransactionOutcome;
@@ -473,8 +485,8 @@ export declare const useLinkly: () => {
473
485
  };
474
486
  };
475
487
  tipAmount: number;
476
- maskedCard: string;
477
- cardScheme: string;
488
+ maskedCard: string | null;
489
+ cardScheme: string | null;
478
490
  }>;
479
491
  reprintReceipt: (txnRef?: string) => Promise< ReceiptReprintReturn>;
480
492
  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-CT1cdbii.js";
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-BICvJBrk.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 };