@achyutlabsau/vue-payment-gateway 0.4.0 → 0.4.2

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.
@@ -416,7 +416,7 @@ const useTillPayment = () => {
416
416
  environment: "SANDBOX"
417
417
  });
418
418
  const initiateTillPurchase = async (paymentAmount) => {
419
- var _a, _b;
419
+ var _a, _b, _c, _d, _e;
420
420
  const cancelTxn = () => {
421
421
  dialog.update({
422
422
  message: "Trying to cancel transaction...",
@@ -442,7 +442,8 @@ const useTillPayment = () => {
442
442
  success: false,
443
443
  transactionId: null,
444
444
  customerReceipt: null,
445
- merchantReceipt: null
445
+ merchantReceipt: null,
446
+ surchargeAmount: 0
446
447
  };
447
448
  }
448
449
  if (res.transactionOutcome === TransactionOutcome.Accepted) {
@@ -461,11 +462,12 @@ const useTillPayment = () => {
461
462
  success: res.transactionOutcome === TransactionOutcome.Accepted,
462
463
  transactionId: res.data.intentId,
463
464
  customerReceipt: (_a = res.data) == null ? void 0 : _a.customerReceipt,
464
- merchantReceipt: (_b = res.data) == null ? void 0 : _b.merchantReceipt
465
+ merchantReceipt: (_b = res.data) == null ? void 0 : _b.merchantReceipt,
466
+ surchargeAmount: ((_e = (_d = (_c = res.data) == null ? void 0 : _c.transactionDetails) == null ? void 0 : _d.amount) == null ? void 0 : _e.surcharge) ?? 0
465
467
  };
466
468
  };
467
469
  const initiateTillRefund = async (paymentAmount) => {
468
- var _a, _b;
470
+ var _a, _b, _c, _d, _e;
469
471
  const cancelTxn = () => {
470
472
  dialog.update({
471
473
  message: "Trying to cancel transaction...",
@@ -491,7 +493,8 @@ const useTillPayment = () => {
491
493
  success: false,
492
494
  transactionId: null,
493
495
  customerReceipt: null,
494
- merchantReceipt: null
496
+ merchantReceipt: null,
497
+ surchargeAmount: 0
495
498
  };
496
499
  }
497
500
  if (res.transactionOutcome === TransactionOutcome.Accepted) {
@@ -509,7 +512,8 @@ const useTillPayment = () => {
509
512
  success: res.transactionOutcome === TransactionOutcome.Accepted,
510
513
  transactionId: res.data.intentId,
511
514
  customerReceipt: (_a = res.data) == null ? void 0 : _a.customerReceipt,
512
- merchantReceipt: (_b = res.data) == null ? void 0 : _b.merchantReceipt
515
+ merchantReceipt: (_b = res.data) == null ? void 0 : _b.merchantReceipt,
516
+ surchargeAmount: ((_e = (_d = (_c = res.data) == null ? void 0 : _c.transactionDetails) == null ? void 0 : _d.amount) == null ? void 0 : _e.surcharge) ?? 0
513
517
  };
514
518
  };
515
519
  const reprintReceipt = async (txnId) => {
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import "./TransactionDialog.vue_vue_type_script_setup_true_lang-DTIELKw0.js";
13
13
  import { _ as _sfc_main$3 } from "./PairLinkly.vue_vue_type_script_setup_true_lang-Dcg0IDxC.js";
14
14
  import { _ as _sfc_main$6 } from "./PairSmartPay.vue_vue_type_script_setup_true_lang-BH-rrj07.js";
15
15
  import "dayjs";
16
- import { _ as _sfc_main$5 } from "./PairTillPayment.vue_vue_type_script_setup_true_lang-rGuP7j0T.js";
16
+ import { _ as _sfc_main$5 } from "./PairTillPayment.vue_vue_type_script_setup_true_lang-Dqadcm_P.js";
17
17
  import { g } from "./index-e4lpzJsL.js";
18
18
  var ReceiptTypes = /* @__PURE__ */ ((ReceiptTypes2) => {
19
19
  ReceiptTypes2["MERCHANT_COPY"] = "MERCHANT_COPY";
@@ -206,6 +206,14 @@ export declare interface TillApiConfig {
206
206
  retryAttempts?: number;
207
207
  }
208
208
 
209
+ declare interface TillPaymentReturn {
210
+ success: boolean;
211
+ transactionId: string | null;
212
+ customerReceipt?: string | null;
213
+ merchantReceipt?: string | null;
214
+ surchargeAmount: number;
215
+ }
216
+
209
217
  export declare class TillPaymentsApi {
210
218
  private readonly api;
211
219
  private readonly config;
@@ -328,28 +336,8 @@ export declare enum TransactionType {
328
336
  }
329
337
 
330
338
  export declare const useTillPayment: () => {
331
- initiateTillPurchase: (paymentAmount: number) => Promise<{
332
- success: boolean;
333
- transactionId: null;
334
- customerReceipt: null;
335
- merchantReceipt: null;
336
- } | {
337
- success: boolean;
338
- transactionId: string;
339
- customerReceipt: string | null | undefined;
340
- merchantReceipt: string | null | undefined;
341
- }>;
342
- initiateTillRefund: (paymentAmount: number) => Promise<{
343
- success: boolean;
344
- transactionId: null;
345
- customerReceipt: null;
346
- merchantReceipt: null;
347
- } | {
348
- success: boolean;
349
- transactionId: string;
350
- customerReceipt: string | null | undefined;
351
- merchantReceipt: string | null | undefined;
352
- }>;
339
+ initiateTillPurchase: (paymentAmount: number) => Promise<TillPaymentReturn>;
340
+ initiateTillRefund: (paymentAmount: number) => Promise<TillPaymentReturn>;
353
341
  reprintReceipt: (txnId: string) => Promise<IError_2>;
354
342
  tillPayment: TillPaymentsApi;
355
343
  };
@@ -1,4 +1,4 @@
1
- import { _, S, T, b, a, u } from "./PairTillPayment.vue_vue_type_script_setup_true_lang-rGuP7j0T.js";
1
+ import { _, S, T, b, a, u } from "./PairTillPayment.vue_vue_type_script_setup_true_lang-Dqadcm_P.js";
2
2
  export {
3
3
  _ as PairTillPayment,
4
4
  S as SettlementTypes,
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
- {
2
- "name": "@achyutlabsau/vue-payment-gateway",
3
- "private": false,
4
- "version": "0.4.0",
5
- "type": "module",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/Achyut-Labs/al-pay-npm-pkg.git"
9
- },
10
- "bugs": {
11
- "url": "https://github.com/Achyut-Labs/al-pay-npm-pkg/issues"
12
- },
13
- "homepage": "https://github.com/Achyut-Labs/al-pay-npm-pkg#readme",
14
- "files": [
15
- "dist"
16
- ],
17
- "main": "./dist/index.js",
18
- "module": "./dist/index.js",
19
- "exports": {
20
- "./worldline": {
21
- "types": "./dist/worldline.d.ts",
22
- "import": "./dist/worldline.js"
23
- },
24
- "./mx51": {
25
- "types": "./dist/mx51.d.ts",
26
- "import": "./dist/mx51.js"
27
- },
28
- "./till-payment": {
29
- "types": "./dist/till-payment.d.ts",
30
- "import": "./dist/till-payment.js"
31
- },
32
- "./linkly": {
33
- "types": "./dist/linkly.d.ts",
34
- "import": "./dist/linkly.js"
35
- },
36
- "./smartpay": {
37
- "types": "./dist/smartpay.d.ts",
38
- "import": "./dist/smartpay.js"
39
- },
40
- "./tyro": {
41
- "types": "./dist/tyro.d.ts",
42
- "import": "./dist/tyro.js"
43
- },
44
- ".": {
45
- "types": "./dist/index.d.ts",
46
- "import": "./dist/index.js"
47
- }
48
- },
49
- "scripts": {
50
- "dev": "cd examples && vite",
51
- "build": "vue-tsc -b && vite build",
52
- "preview": "vite preview",
53
- "docs:dev": "vitepress dev docs",
54
- "docs:build": "vitepress build docs",
55
- "docs:preview": "vitepress preview docs"
56
- },
57
- "dependencies": {
58
- "uuid": "^11.1.0",
59
- "@vueuse/core": "^13.1.0",
60
- "axios": "^1.8.4",
61
- "dayjs": "^1.11.13",
62
- "@mx51/spi-client-js": "^2.9.13",
63
- "@vueuse/rxjs": "^13.1.0",
64
- "dexie": "^4.0.11"
65
- },
66
- "peerDependencies": {
67
- "@vueuse/core": "*",
68
- "axios": "^1.7.x",
69
- "dayjs": "^1.x.x",
70
- "quasar": "^2.x.x",
71
- "uuid": "^11.x.x",
72
- "vue": "^3.5.x"
73
- },
74
- "devDependencies": {
75
- "@quasar/extras": "^1.16.17",
76
- "@tailwindcss/vite": "^4.1.4",
77
- "@types/node": "^22.14.1",
78
- "@vitejs/plugin-vue": "^5.2.3",
79
- "prettier": "^3.5.3",
80
- "prettier-plugin-tailwindcss": "^0.6.11",
81
- "quasar": "^2.x.x",
82
- "tailwindcss": "^4.1.4",
83
- "typescript": "5.8.3",
84
- "vite": "^6.3.2",
85
- "vite-plugin-dts": "^4.5.3",
86
- "vitepress": "^2.0.0-alpha.4",
87
- "vue": "^3.5.13",
88
- "vue-tsc": "^2.2.8"
89
- }
90
- }
1
+ {
2
+ "name": "@achyutlabsau/vue-payment-gateway",
3
+ "private": false,
4
+ "version": "0.4.2",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Achyut-Labs/al-pay-npm-pkg.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/Achyut-Labs/al-pay-npm-pkg/issues"
12
+ },
13
+ "homepage": "https://github.com/Achyut-Labs/al-pay-npm-pkg#readme",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "exports": {
20
+ "./worldline": {
21
+ "types": "./dist/worldline.d.ts",
22
+ "import": "./dist/worldline.js"
23
+ },
24
+ "./mx51": {
25
+ "types": "./dist/mx51.d.ts",
26
+ "import": "./dist/mx51.js"
27
+ },
28
+ "./till-payment": {
29
+ "types": "./dist/till-payment.d.ts",
30
+ "import": "./dist/till-payment.js"
31
+ },
32
+ "./linkly": {
33
+ "types": "./dist/linkly.d.ts",
34
+ "import": "./dist/linkly.js"
35
+ },
36
+ "./smartpay": {
37
+ "types": "./dist/smartpay.d.ts",
38
+ "import": "./dist/smartpay.js"
39
+ },
40
+ "./tyro": {
41
+ "types": "./dist/tyro.d.ts",
42
+ "import": "./dist/tyro.js"
43
+ },
44
+ ".": {
45
+ "types": "./dist/index.d.ts",
46
+ "import": "./dist/index.js"
47
+ }
48
+ },
49
+ "scripts": {
50
+ "dev": "cd examples && vite",
51
+ "build": "vue-tsc -b && vite build",
52
+ "preview": "vite preview",
53
+ "docs:dev": "vitepress dev docs",
54
+ "docs:build": "vitepress build docs",
55
+ "docs:preview": "vitepress preview docs"
56
+ },
57
+ "dependencies": {
58
+ "uuid": "^11.1.0",
59
+ "@vueuse/core": "^13.1.0",
60
+ "axios": "^1.8.4",
61
+ "dayjs": "^1.11.13",
62
+ "@mx51/spi-client-js": "^2.9.13",
63
+ "@vueuse/rxjs": "^13.1.0",
64
+ "dexie": "^4.0.11"
65
+ },
66
+ "peerDependencies": {
67
+ "@vueuse/core": "*",
68
+ "axios": "^1.7.x",
69
+ "dayjs": "^1.x.x",
70
+ "quasar": "^2.x.x",
71
+ "uuid": "^11.x.x",
72
+ "vue": "^3.5.x"
73
+ },
74
+ "devDependencies": {
75
+ "@quasar/extras": "^1.16.17",
76
+ "@tailwindcss/vite": "^4.1.4",
77
+ "@types/node": "^22.14.1",
78
+ "@vitejs/plugin-vue": "^5.2.3",
79
+ "prettier": "^3.5.3",
80
+ "prettier-plugin-tailwindcss": "^0.6.11",
81
+ "quasar": "^2.x.x",
82
+ "tailwindcss": "^4.1.4",
83
+ "typescript": "5.8.3",
84
+ "vite": "^6.3.2",
85
+ "vite-plugin-dts": "^4.5.3",
86
+ "vitepress": "^2.0.0-alpha.4",
87
+ "vue": "^3.5.13",
88
+ "vue-tsc": "^2.2.8"
89
+ }
90
+ }