@achyutlabsau/vue-payment-gateway 0.15.0 → 0.15.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.
@@ -11,6 +11,8 @@ function v(e) {
11
11
  amount: null,
12
12
  tipAmount: null,
13
13
  surchargeAmount: null,
14
+ maskedCard: null,
15
+ cardScheme: null,
14
16
  receipts: {},
15
17
  raw: null,
16
18
  ...e,
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@ 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
5
  import { n as f } from "./utils-LqvcWjKL.js";
6
- import { t as p } from "./linkly-yernhu9V.js";
7
- import { t as m } from "./smartpay-BSvt0cIh.js";
8
- import { t as h } from "./till-payment-DSScmuag.js";
9
- import { t as g } from "./valpay--SOqhe0M.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";
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,7 +1,7 @@
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
2
  import { i as s, n as c, r as l, t as u } from "./utils-LqvcWjKL.js";
3
3
  import { t as d } from "./utils-BPFf60Ai.js";
4
- import { t as f } from "./core-nvcK0Nr9.js";
4
+ import { t as f } from "./core-BMUVlh-t.js";
5
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
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
7
  import { useLocalStorage as oe } from "@vueuse/core";
@@ -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: t.response?.pan ?? null,
283
+ cardScheme: t.response?.cardType ?? 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: t.response?.pan ?? null,
289
+ cardScheme: t.response?.cardType ?? 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: t.response?.pan ?? null,
295
+ cardScheme: t.response?.cardType ?? 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: t.response?.pan ?? null,
301
+ cardScheme: t.response?.cardType ?? null
294
302
  });
295
303
  } catch (e) {
296
304
  throw i.failed("Transaction Failed!"), e;
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;
428
+ cardScheme: string;
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;
477
+ cardScheme: string;
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-yernhu9V.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-CT1cdbii.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 };
@@ -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({
@@ -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-BSvt0cIh.js";
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-ebnYmikX.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,6 +1,6 @@
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
2
  import { t as o } from "./utils-LqvcWjKL.js";
3
- import { n as s, r as c, t as l } from "./core-nvcK0Nr9.js";
3
+ import { n as s, r as c, t as l } from "./core-BMUVlh-t.js";
4
4
  import { createBlock as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, onMounted as g, openBlock as _, ref as v, renderSlot as y, resolveDirective as b, toDisplayString as x, unref as S, useModel as C, withCtx as w, withDirectives as T } from "vue";
5
5
  import { Dialog as E, Loading as D, Notify as O, QBtn as k, QCard as A, QCardActions as j, QCardSection as M, QDialog as N, QForm as P, QIcon as F, QInput as I, QSelect as L, QToolbar as R, QToolbarTitle as z } from "quasar";
6
6
  import { useLocalStorage as B } from "@vueuse/core";
@@ -262,14 +262,16 @@ function ne(e) {
262
262
  message: e.message,
263
263
  raw: e
264
264
  });
265
- let t = Z(e.transactionOutcome), n = e.data?.transactionDetails, r = {};
266
- return e.data?.merchantReceipt && (r.merchant = e.data.merchantReceipt), e.data?.customerReceipt && (r.customer = e.data.customerReceipt), c({
265
+ let t = Z(e.transactionOutcome), n = e.data?.transactionDetails, r = n?.paymentMethod?.card, i = r?.last4Digit ? `**** **** **** ${r.last4Digit}` : null, a = {};
266
+ return e.data?.merchantReceipt && (a.merchant = e.data.merchantReceipt), e.data?.customerReceipt && (a.customer = e.data.customerReceipt), c({
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
- receipts: r,
272
+ maskedCard: i,
273
+ cardScheme: r?.scheme ?? null,
274
+ receipts: a,
273
275
  message: e.message ?? (t === s.Approved ? "Transaction Accepted!" : `Transaction ${e.transactionOutcome}!`),
274
276
  raw: e.data ?? null
275
277
  });
@@ -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. */
@@ -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-DSScmuag.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./till-payment-D4iFCkpk.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,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-nvcK0Nr9.js";
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--SOqhe0M.js";
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@achyutlabsau/vue-payment-gateway",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Achyut-Labs/al-pay-npm-pkg#readme",
6
6
  "bugs": {