@payware/mcp-server 1.3.3 → 1.5.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/.env.example +4 -0
- package/README.md +18 -0
- package/package.json +7 -9
- package/src/auth/rsa-keys.js +12 -6
- package/src/auth/sandbox-setup.js +2 -0
- package/src/config/toolsets.js +104 -0
- package/src/core/auth/jwt-factory.js +4 -1
- package/src/core/auth/jwt-token.js +4 -0
- package/src/index.js +10 -6
- package/src/isv/data/index.js +15 -14
- package/src/isv/deep-links/delete-product-link.js +3 -2
- package/src/isv/deep-links/delete-transaction-link.js +3 -2
- package/src/isv/deep-links/get-product-link.js +8 -6
- package/src/isv/deep-links/get-transaction-link.js +8 -6
- package/src/isv/index.js +6 -0
- package/src/isv/invitations/index.js +5 -0
- package/src/isv/oauth2/get-token-info.js +3 -0
- package/src/isv/oauth2/obtain-token.js +3 -0
- package/src/isv/oauth2/token-helper.js +2 -0
- package/src/isv/poi/cancel-price.js +2 -0
- package/src/isv/poi/get-poi.js +2 -0
- package/src/isv/poi/get-qrcode.js +40 -9
- package/src/isv/poi/get-status.js +2 -0
- package/src/isv/poi/list-pois.js +2 -0
- package/src/isv/poi/set-price.js +2 -0
- package/src/isv/products/audios.js +8 -2
- package/src/isv/products/create-product.js +2 -0
- package/src/isv/products/delete-product.js +2 -0
- package/src/isv/products/get-product-image.js +2 -0
- package/src/isv/products/get-product.js +2 -0
- package/src/isv/products/list-products.js +2 -0
- package/src/isv/products/schedules.js +6 -0
- package/src/isv/products/update-product.js +2 -0
- package/src/isv/reference/index.js +2 -0
- package/src/isv/transactions/cancel-transaction.js +2 -0
- package/src/isv/transactions/create-transaction.js +14 -2
- package/src/isv/transactions/get-status.js +3 -1
- package/src/isv/transactions/process-transaction.js +14 -2
- package/src/isv/transactions/simulate-callback.js +2 -0
- package/src/isv/transactions/transaction-history.js +2 -0
- package/src/merchant/data/export-report.js +2 -0
- package/src/merchant/data/generate-report.js +2 -0
- package/src/merchant/data/get-export-list.js +2 -0
- package/src/merchant/data/get-report-requests.js +2 -0
- package/src/merchant/data/get-report-status.js +2 -0
- package/src/merchant/data/index.js +15 -10
- package/src/merchant/data/list-reports.js +2 -0
- package/src/merchant/deep-links/delete-product-link.js +3 -2
- package/src/merchant/deep-links/delete-transaction-link.js +3 -2
- package/src/merchant/deep-links/get-product-link.js +8 -6
- package/src/merchant/deep-links/get-transaction-link.js +8 -6
- package/src/merchant/index.js +7 -1
- package/src/merchant/logs/index.js +4 -0
- package/src/merchant/products/audios.js +15 -14
- package/src/merchant/products/create-product.js +3 -2
- package/src/merchant/products/delete-product.js +3 -2
- package/src/merchant/products/get-product-image.js +3 -2
- package/src/merchant/products/get-product.js +3 -2
- package/src/merchant/products/list-products.js +3 -2
- package/src/merchant/products/schedules.js +11 -10
- package/src/merchant/products/update-product.js +3 -2
- package/src/merchant/transactions/cancel-transaction.js +4 -3
- package/src/merchant/transactions/create-transaction.js +14 -2
- package/src/merchant/transactions/get-status.js +4 -3
- package/src/merchant/transactions/process-transaction.js +17 -6
- package/src/merchant/transactions/simulate-callback.js +3 -0
- package/src/merchant/transactions/transaction-history.js +5 -4
- package/src/payment-institution/data/index.js +15 -14
- package/src/payment-institution/deep-links/delete-transaction-link.js +3 -2
- package/src/payment-institution/deep-links/get-transaction-link.js +8 -6
- package/src/payment-institution/transactions/create-pi-transaction.js +15 -4
- package/src/payment-institution/transactions/finalize-transaction.js +7 -4
- package/src/payment-institution/transactions/get-transaction-history.js +7 -4
- package/src/payment-institution/transactions/get-transaction-status.js +15 -12
- package/src/payment-institution/transactions/process-pi-transaction.js +19 -8
- package/src/payment-institution/transactions/simulate-pi-callback.js +3 -0
- package/src/payment-institution/transactions/soundbite-transaction.js +5 -4
- package/src/proxy-server.js +25 -0
- package/src/shared/placements/api.js +51 -0
- package/src/shared/placements/tools.js +519 -0
- package/src/shared/poi/poi-create-api.js +3 -0
- package/src/shared/products/products-api.js +36 -25
- package/src/shared/shops/shops-api.js +2 -0
- package/src/shared/tool-annotations.js +53 -0
- package/src/tools/advanced-code-generator.js +3 -0
- package/src/utils/format-request.js +2 -0
- package/src/utils/json-formatter.js +2 -0
- package/src/utils/server-info.js +2 -0
- package/src/utils/code-examples.js +0 -646
|
@@ -2,6 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import { createJWTForPartner } from '../../core/auth/jwt-factory.js';
|
|
3
3
|
import { getSandboxUrl, getProductionUrl, getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
4
4
|
import { describeApiError } from '../../shared/api-errors.js';
|
|
5
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Get one completed transaction as an ISV acting on behalf of a merchant.
|
|
@@ -68,6 +69,7 @@ export async function getTransactionHistory({
|
|
|
68
69
|
|
|
69
70
|
export const getTransactionHistoryTool = {
|
|
70
71
|
name: 'payware_operations_get_transaction_history',
|
|
72
|
+
annotations: READS,
|
|
71
73
|
description: `Get one completed or expired transaction as an ISV on behalf of a merchant.
|
|
72
74
|
|
|
73
75
|
**Endpoint:** GET /transactions-history/{transactionId}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { exportReport, EXPORT_FORMATS } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { CREATES } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Export report tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const exportReportTool = {
|
|
8
9
|
name: "payware_data_export_report",
|
|
10
|
+
annotations: CREATES,
|
|
9
11
|
description: "Export a READY report in a specific format (PDF, CSV, Excel, JSON). The report must be in READY status first.",
|
|
10
12
|
inputSchema: {
|
|
11
13
|
type: "object",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { generateReport, REPORT_TYPES, LOCALES } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { CREATES } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Generate report tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const generateReportTool = {
|
|
8
9
|
name: "payware_data_generate_report",
|
|
10
|
+
annotations: CREATES,
|
|
9
11
|
description: `Generate an asynchronous data report for merchant data analysis and reporting. Production only - not supported in sandbox.
|
|
10
12
|
|
|
11
13
|
⚠️ **Running a report is entitlement-checked as of 2026-08-22.** Naming a report answers **403
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getExportList } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get export list for request tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const getExportListTool = {
|
|
8
9
|
name: "payware_data_get_export_list",
|
|
10
|
+
annotations: READS,
|
|
9
11
|
description: "Get all export attempts for a specific report request. Returns list of exports in various formats with their status and download information. Production only - not supported in sandbox.",
|
|
10
12
|
inputSchema: {
|
|
11
13
|
type: "object",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getReportRequests, REPORT_TYPES } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get report request history tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const getReportRequestsTool = {
|
|
8
9
|
name: "payware_data_get_report_requests",
|
|
10
|
+
annotations: READS,
|
|
9
11
|
description: "Get all execution requests for a specific report type. Returns historical execution records with status and parameters. Production only - not supported in sandbox.",
|
|
10
12
|
inputSchema: {
|
|
11
13
|
type: "object",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getReportStatus } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get report status tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const getReportStatusTool = {
|
|
8
9
|
name: "payware_data_get_report_status",
|
|
10
|
+
annotations: READS,
|
|
9
11
|
description: "Get the status of an asynchronous report generation request. Use this to monitor report progress.",
|
|
10
12
|
inputSchema: {
|
|
11
13
|
type: "object",
|
|
@@ -20,12 +20,14 @@ import { exportReportTool } from './export-report.js';
|
|
|
20
20
|
import { listReportsTool } from './list-reports.js';
|
|
21
21
|
import { getReportRequestsTool } from './get-report-requests.js';
|
|
22
22
|
import { getExportListTool } from './get-export-list.js';
|
|
23
|
+
import { ADDS, CHANGES, READS } from '../../shared/tool-annotations.js';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Get export status tool for merchants
|
|
26
27
|
*/
|
|
27
28
|
export const getExportStatusTool = {
|
|
28
29
|
name: "payware_data_get_export_status",
|
|
30
|
+
annotations: READS,
|
|
29
31
|
description: "Get the status of a report export request. Use this to monitor export progress.",
|
|
30
32
|
inputSchema: {
|
|
31
33
|
type: "object",
|
|
@@ -41,8 +43,7 @@ export const getExportStatusTool = {
|
|
|
41
43
|
},
|
|
42
44
|
privateKey: {
|
|
43
45
|
type: "string",
|
|
44
|
-
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
45
|
-
default: getPrivateKeySafe()
|
|
46
|
+
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
49
|
required: ["exportId"]
|
|
@@ -117,6 +118,7 @@ ${downloadInfo}
|
|
|
117
118
|
*/
|
|
118
119
|
export const downloadExportTool = {
|
|
119
120
|
name: "payware_data_download_export",
|
|
121
|
+
annotations: ADDS,
|
|
120
122
|
description: "Download a READY export file. The export must be in READY status. Returns binary data for the file.",
|
|
121
123
|
inputSchema: {
|
|
122
124
|
type: "object",
|
|
@@ -127,7 +129,7 @@ export const downloadExportTool = {
|
|
|
127
129
|
},
|
|
128
130
|
saveToFile: {
|
|
129
131
|
type: "boolean",
|
|
130
|
-
description: "Whether to save the downloaded file to disk. If true, saves to
|
|
132
|
+
description: "Whether to save the downloaded file to disk. If true, saves it to a payware-mcp-downloads folder in the system temp directory and returns the path. If false, only shows metadata/preview.",
|
|
131
133
|
default: false
|
|
132
134
|
},
|
|
133
135
|
partnerId: {
|
|
@@ -181,11 +183,14 @@ export const downloadExportTool = {
|
|
|
181
183
|
};
|
|
182
184
|
const extension = extensionMap[contentType] || 'bin';
|
|
183
185
|
const filename = `report_${exportId.substring(0, 8)}.${extension}`;
|
|
184
|
-
|
|
186
|
+
// The temp directory is writable wherever the server runs; its working directory, set by the
|
|
187
|
+
// MCP client, often is not. This was a fixed developer path, which no other machine has.
|
|
188
|
+
const os = await import('os');
|
|
189
|
+
const path = await import('path');
|
|
190
|
+
const filepath = path.join(os.tmpdir(), 'payware-mcp-downloads', filename);
|
|
185
191
|
|
|
186
192
|
// Save file to downloads directory
|
|
187
193
|
const fs = await import('fs');
|
|
188
|
-
const path = await import('path');
|
|
189
194
|
const downloadDir = path.dirname(filepath);
|
|
190
195
|
|
|
191
196
|
// Create downloads directory if it doesn't exist
|
|
@@ -222,7 +227,7 @@ ${savedFileInfo}${contentPreview}
|
|
|
222
227
|
**Summary:**
|
|
223
228
|
✅ ${saveToFile ? 'File saved to disk and' : 'File'} downloaded successfully
|
|
224
229
|
|
|
225
|
-
${saveToFile ? '**Tip:** The file has been saved and can be opened with the appropriate application.' : '**Tip:** Use `saveToFile: true` parameter to save the file to disk
|
|
230
|
+
${saveToFile ? '**Tip:** The file has been saved and can be opened with the appropriate application.' : '**Tip:** Use `saveToFile: true` parameter to save the file to disk'}`
|
|
226
231
|
}]
|
|
227
232
|
};
|
|
228
233
|
} catch (error) {
|
|
@@ -236,6 +241,7 @@ ${saveToFile ? '**Tip:** The file has been saved and can be opened with the appr
|
|
|
236
241
|
*/
|
|
237
242
|
export const cancelReportTool = {
|
|
238
243
|
name: "payware_data_cancel_report",
|
|
244
|
+
annotations: CHANGES,
|
|
239
245
|
description: "Cancel a running report generation. Only reports in QUEUED status can be cancelled.",
|
|
240
246
|
inputSchema: {
|
|
241
247
|
type: "object",
|
|
@@ -251,8 +257,7 @@ export const cancelReportTool = {
|
|
|
251
257
|
},
|
|
252
258
|
privateKey: {
|
|
253
259
|
type: "string",
|
|
254
|
-
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
255
|
-
default: getPrivateKeySafe()
|
|
260
|
+
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
256
261
|
}
|
|
257
262
|
},
|
|
258
263
|
required: ["requestId"]
|
|
@@ -307,6 +312,7 @@ Only reports in QUEUED status can be cancelled. Reports that are already READY,
|
|
|
307
312
|
*/
|
|
308
313
|
export const cancelExportTool = {
|
|
309
314
|
name: "payware_data_cancel_export",
|
|
315
|
+
annotations: CHANGES,
|
|
310
316
|
description: "Cancel a running export process. Only exports in QUEUED status can be cancelled.",
|
|
311
317
|
inputSchema: {
|
|
312
318
|
type: "object",
|
|
@@ -322,8 +328,7 @@ export const cancelExportTool = {
|
|
|
322
328
|
},
|
|
323
329
|
privateKey: {
|
|
324
330
|
type: "string",
|
|
325
|
-
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
326
|
-
default: getPrivateKeySafe()
|
|
331
|
+
description: "RSA private key for authentication. Uses environment-specific private key as default."
|
|
327
332
|
}
|
|
328
333
|
},
|
|
329
334
|
required: ["exportId"]
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { listReports } from '../../shared/data/data-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* List all available reports tool for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const listReportsTool = {
|
|
8
9
|
name: "payware_data_list_reports",
|
|
10
|
+
annotations: READS,
|
|
9
11
|
description: "List all available report types with their configurations, descriptions, and visibility settings. Production only - not supported in sandbox.",
|
|
10
12
|
inputSchema: {
|
|
11
13
|
type: "object",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { deleteProductDeepLink } from '../../shared/deep-links/api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { CHANGES } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Delete deep link for a merchant product
|
|
6
7
|
*/
|
|
7
8
|
export const deleteProductLinkTool = {
|
|
8
9
|
name: "payware_deep_links_delete_product_link",
|
|
10
|
+
annotations: CHANGES,
|
|
9
11
|
description: `Delete an active deep link for a product. Once deleted, the deep link URL will no longer redirect to the payware mobile app.
|
|
10
12
|
|
|
11
13
|
**Use Cases:**
|
|
@@ -33,8 +35,7 @@ export const deleteProductLinkTool = {
|
|
|
33
35
|
},
|
|
34
36
|
privateKey: {
|
|
35
37
|
type: "string",
|
|
36
|
-
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
37
|
-
default: getPrivateKeySafe()
|
|
38
|
+
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
required: ["productId"]
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { deleteTransactionDeepLink } from '../../shared/deep-links/api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { CHANGES } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Delete deep link for a merchant transaction
|
|
6
7
|
*/
|
|
7
8
|
export const deleteTransactionLinkTool = {
|
|
8
9
|
name: "payware_deep_links_delete_transaction_link",
|
|
10
|
+
annotations: CHANGES,
|
|
9
11
|
description: `Delete an active deep link for a transaction. Once deleted, the deep link URL will no longer redirect to the payware mobile app.
|
|
10
12
|
|
|
11
13
|
**Use Cases:**
|
|
@@ -33,8 +35,7 @@ export const deleteTransactionLinkTool = {
|
|
|
33
35
|
},
|
|
34
36
|
privateKey: {
|
|
35
37
|
type: "string",
|
|
36
|
-
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
37
|
-
default: getPrivateKeySafe()
|
|
38
|
+
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
required: ["transactionId"]
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { getProductDeepLink } from '../../shared/deep-links/api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { ADDS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get deep link for a merchant product
|
|
6
7
|
*/
|
|
7
8
|
export const getProductLinkTool = {
|
|
8
9
|
name: "payware_deep_links_get_product_link",
|
|
9
|
-
|
|
10
|
+
annotations: ADDS,
|
|
11
|
+
description: `Get an active deep link for a product. Returns a clickable URL that redirects to the payware mobile app. For a link whose payments are attributed to one placement of the product (a poster, an ad, a mailing), use payware_products_get_placement_link instead.
|
|
10
12
|
|
|
11
13
|
**Deep Link Format:**
|
|
12
14
|
- Web URL: https://go.payware.eu/{productId}
|
|
13
|
-
- Mobile Redirect: payware
|
|
15
|
+
- Mobile Redirect: payware:/{productId} (one slash: the identifier is case-sensitive, so it must not sit in the URI host, which redirect services lowercase)
|
|
14
16
|
|
|
15
17
|
**Use Cases:**
|
|
16
18
|
- Mobile-only e-commerce product references
|
|
@@ -19,6 +21,7 @@ export const getProductLinkTool = {
|
|
|
19
21
|
|
|
20
22
|
**Important Notes:**
|
|
21
23
|
- Deep links are only supported in production environment
|
|
24
|
+
- Apps that open payware links must accept \`payware:\` followed by one, two or three slashes (QR codes and NFC tags carry \`payware://{id}\`): read the identifier after the scheme and any slashes, up to \`/\`, \`?\` or \`#\`, and keep its case
|
|
22
25
|
- Link expiration is synchronized with the referenced product
|
|
23
26
|
- Traditional deep links that route to app content when app is installed`,
|
|
24
27
|
|
|
@@ -37,8 +40,7 @@ export const getProductLinkTool = {
|
|
|
37
40
|
},
|
|
38
41
|
privateKey: {
|
|
39
42
|
type: "string",
|
|
40
|
-
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
41
|
-
default: getPrivateKeySafe()
|
|
43
|
+
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
46
|
required: ["productId"]
|
|
@@ -82,7 +84,7 @@ export const getProductLinkTool = {
|
|
|
82
84
|
**Deep Link Details:**
|
|
83
85
|
- Product ID: ${productId}
|
|
84
86
|
- Web URL: ${linkUrl}
|
|
85
|
-
- Mobile Redirect: payware
|
|
87
|
+
- Mobile Redirect: payware:/${productId}
|
|
86
88
|
|
|
87
89
|
**Link Information:**
|
|
88
90
|
- Status: Active
|
|
@@ -101,7 +103,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
101
103
|
|
|
102
104
|
**Usage:**
|
|
103
105
|
1. Share the web URL: \`${linkUrl}\`
|
|
104
|
-
2. On mobile devices, it will redirect to: \`payware
|
|
106
|
+
2. On mobile devices, it will redirect to: \`payware:/${productId}\`
|
|
105
107
|
3. Link expires when the product expires
|
|
106
108
|
4. Recreate if product is updated`
|
|
107
109
|
}]
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { getTransactionDeepLink } from '../../shared/deep-links/api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { ADDS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get deep link for a merchant transaction
|
|
6
7
|
*/
|
|
7
8
|
export const getTransactionLinkTool = {
|
|
8
9
|
name: "payware_deep_links_get_transaction_link",
|
|
10
|
+
annotations: ADDS,
|
|
9
11
|
description: `Get an active deep link for a transaction. Returns a clickable URL that redirects to the payware mobile app.
|
|
10
12
|
|
|
11
13
|
**Deep Link Format:**
|
|
12
14
|
- Web URL: https://go.payware.eu/{transactionId}
|
|
13
|
-
- Mobile Redirect: payware
|
|
15
|
+
- Mobile Redirect: payware:/{transactionId} (one slash: the identifier is case-sensitive, so it must not sit in the URI host, which redirect services lowercase)
|
|
14
16
|
|
|
15
17
|
**Use Cases:**
|
|
16
18
|
- P2P payments via messaging services
|
|
@@ -19,6 +21,7 @@ export const getTransactionLinkTool = {
|
|
|
19
21
|
|
|
20
22
|
**Important Notes:**
|
|
21
23
|
- Deep links are only supported in production environment
|
|
24
|
+
- Apps that open payware links must accept \`payware:\` followed by one, two or three slashes (QR codes and NFC tags carry \`payware://{id}\`): read the identifier after the scheme and any slashes, up to \`/\`, \`?\` or \`#\`, and keep its case
|
|
22
25
|
- Link expiration is synchronized with the referenced transaction
|
|
23
26
|
- Traditional deep links that route to app content when app is installed`,
|
|
24
27
|
|
|
@@ -37,8 +40,7 @@ export const getTransactionLinkTool = {
|
|
|
37
40
|
},
|
|
38
41
|
privateKey: {
|
|
39
42
|
type: "string",
|
|
40
|
-
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
41
|
-
default: getPrivateKeySafe()
|
|
43
|
+
description: "RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
46
|
required: ["transactionId"]
|
|
@@ -82,7 +84,7 @@ export const getTransactionLinkTool = {
|
|
|
82
84
|
**Deep Link Details:**
|
|
83
85
|
- Transaction ID: ${transactionId}
|
|
84
86
|
- Web URL: ${linkUrl}
|
|
85
|
-
- Mobile Redirect: payware
|
|
87
|
+
- Mobile Redirect: payware:/${transactionId}
|
|
86
88
|
|
|
87
89
|
**Link Information:**
|
|
88
90
|
- Status: Active
|
|
@@ -101,7 +103,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
101
103
|
|
|
102
104
|
**Usage:**
|
|
103
105
|
1. Share the web URL: \`${linkUrl}\`
|
|
104
|
-
2. On mobile devices, it will redirect to: \`payware
|
|
106
|
+
2. On mobile devices, it will redirect to: \`payware:/${transactionId}\`
|
|
105
107
|
3. Link expires when the transaction expires
|
|
106
108
|
4. Recreate if transaction is extended`
|
|
107
109
|
}]
|
|
@@ -123,7 +125,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
123
125
|
4. **Invalid transaction ID**: Ensure transaction ID format is correct
|
|
124
126
|
|
|
125
127
|
**Troubleshooting:**
|
|
126
|
-
1. Verify transaction exists using \`
|
|
128
|
+
1. Verify transaction exists using \`payware_operations_get_transaction_status\`
|
|
127
129
|
2. Check if running in production environment
|
|
128
130
|
3. Ensure JWT authentication is working
|
|
129
131
|
4. Confirm transaction is not expired`
|
package/src/merchant/index.js
CHANGED
|
@@ -26,6 +26,9 @@ import { merchantLogsTools } from './logs/index.js';
|
|
|
26
26
|
// Shop tools - needed before any call that takes a shop / shopCode
|
|
27
27
|
import { merchantShopTools } from './shops/index.js';
|
|
28
28
|
|
|
29
|
+
// Campaigns, placements and airings - one definition shared by merchants and ISVs
|
|
30
|
+
import { placementTools } from '../shared/placements/tools.js';
|
|
31
|
+
|
|
29
32
|
// Shared utility tools
|
|
30
33
|
import { getServerInfoTool } from '../utils/server-info.js';
|
|
31
34
|
|
|
@@ -60,7 +63,10 @@ export const merchantTools = [
|
|
|
60
63
|
...merchantLogsTools,
|
|
61
64
|
|
|
62
65
|
// Shop lookup
|
|
63
|
-
...merchantShopTools
|
|
66
|
+
...merchantShopTools,
|
|
67
|
+
|
|
68
|
+
// Campaigns, placements and airings
|
|
69
|
+
...placementTools('merchant')
|
|
64
70
|
];
|
|
65
71
|
|
|
66
72
|
/**
|
|
@@ -12,12 +12,14 @@ import {
|
|
|
12
12
|
LOG_LEVELS
|
|
13
13
|
} from '../../shared/logs/logs-api.js';
|
|
14
14
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
15
|
+
import { LOCAL, READS } from '../../shared/tool-annotations.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Query logs tool for merchants
|
|
18
19
|
*/
|
|
19
20
|
export const queryLogsTool = {
|
|
20
21
|
name: "payware_logs_query",
|
|
22
|
+
annotations: READS,
|
|
21
23
|
description: "Query application logs with filters. Premium plan required. Returns paginated JSON log entries for debugging and monitoring your integration.",
|
|
22
24
|
inputSchema: {
|
|
23
25
|
type: "object",
|
|
@@ -174,6 +176,7 @@ Use cursor \`${nextCursor}\` to fetch the next page of results.` : ''}
|
|
|
174
176
|
*/
|
|
175
177
|
export const getLogStatusTool = {
|
|
176
178
|
name: "payware_logs_status",
|
|
179
|
+
annotations: READS,
|
|
177
180
|
description: "Get log availability and storage information. Premium plan required. Shows if logs are available, total size, and file count.",
|
|
178
181
|
inputSchema: {
|
|
179
182
|
type: "object",
|
|
@@ -262,6 +265,7 @@ ${data.logsAvailable ? `
|
|
|
262
265
|
*/
|
|
263
266
|
export const getLogDownloadUrlTool = {
|
|
264
267
|
name: "payware_logs_download_url",
|
|
268
|
+
annotations: LOCAL,
|
|
265
269
|
description: "Get download URL for logs archive. Premium plan required. Returns URL for downloading logs as gzipped JSON file.",
|
|
266
270
|
inputSchema: {
|
|
267
271
|
type: "object",
|
|
@@ -6,15 +6,17 @@ import {
|
|
|
6
6
|
deleteAudio
|
|
7
7
|
} from '../../shared/products/products-api.js';
|
|
8
8
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
9
|
+
import { CHANGES, CREATES, READS } from '../../shared/tool-annotations.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Register audio tool implementation for merchants
|
|
12
13
|
*/
|
|
13
14
|
export const registerAudioTool = {
|
|
14
15
|
name: "payware_products_register_audio",
|
|
16
|
+
annotations: CREATES,
|
|
15
17
|
description: `Register an audio file (soundbite) for a product to enable audio-based payment initiation.
|
|
16
18
|
|
|
17
|
-
**Supported formats:**
|
|
19
|
+
**Supported formats:** MP3, WAV, OGG, M4A, FLAC, AAC, WMA, MP4, MOV, up to 100 MB, holding 2 to 120 seconds of audio
|
|
18
20
|
**Note:** For video files, only the audio channel is registered`,
|
|
19
21
|
|
|
20
22
|
inputSchema: {
|
|
@@ -36,8 +38,7 @@ export const registerAudioTool = {
|
|
|
36
38
|
},
|
|
37
39
|
privateKey: {
|
|
38
40
|
type: "string",
|
|
39
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
40
|
-
default: getPrivateKeySafe()
|
|
41
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
41
42
|
},
|
|
42
43
|
useSandbox: {
|
|
43
44
|
type: "boolean",
|
|
@@ -126,8 +127,8 @@ ${audio.status === '1' ? '✅ Audio is ready for use in soundbite transactions'
|
|
|
126
127
|
|
|
127
128
|
**Troubleshooting:**
|
|
128
129
|
1. Verify the audio file path exists and is accessible
|
|
129
|
-
2. Check file size (max
|
|
130
|
-
3. Ensure
|
|
130
|
+
2. Check file size (max 100 MB) and length (2 to 120 seconds of audio)
|
|
131
|
+
3. Ensure the format is MP3, WAV, OGG, M4A, FLAC, AAC, WMA, MP4 or MOV
|
|
131
132
|
4. Verify the product ID exists and belongs to your account
|
|
132
133
|
5. Check available storage space`
|
|
133
134
|
}]
|
|
@@ -141,6 +142,7 @@ ${audio.status === '1' ? '✅ Audio is ready for use in soundbite transactions'
|
|
|
141
142
|
*/
|
|
142
143
|
export const getAudiosTool = {
|
|
143
144
|
name: "payware_products_get_audios",
|
|
145
|
+
annotations: READS,
|
|
144
146
|
description: "Get all registered audio files for a product",
|
|
145
147
|
|
|
146
148
|
inputSchema: {
|
|
@@ -158,8 +160,7 @@ export const getAudiosTool = {
|
|
|
158
160
|
},
|
|
159
161
|
privateKey: {
|
|
160
162
|
type: "string",
|
|
161
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
162
|
-
default: getPrivateKeySafe()
|
|
163
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
163
164
|
},
|
|
164
165
|
useSandbox: {
|
|
165
166
|
type: "boolean",
|
|
@@ -253,6 +254,7 @@ ${audiosList}
|
|
|
253
254
|
*/
|
|
254
255
|
export const getAudioTool = {
|
|
255
256
|
name: "payware_products_get_audio",
|
|
257
|
+
annotations: READS,
|
|
256
258
|
description: "Get detailed information about a specific audio file",
|
|
257
259
|
|
|
258
260
|
inputSchema: {
|
|
@@ -274,8 +276,7 @@ export const getAudioTool = {
|
|
|
274
276
|
},
|
|
275
277
|
privateKey: {
|
|
276
278
|
type: "string",
|
|
277
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
278
|
-
default: getPrivateKeySafe()
|
|
279
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
279
280
|
},
|
|
280
281
|
useSandbox: {
|
|
281
282
|
type: "boolean",
|
|
@@ -367,6 +368,7 @@ ${audio.status === '1' ? '✅ **Ready:** Audio is processed and ready for soundb
|
|
|
367
368
|
*/
|
|
368
369
|
export const updateAudioTool = {
|
|
369
370
|
name: "payware_products_update_audio",
|
|
371
|
+
annotations: CHANGES,
|
|
370
372
|
description: "Update audio information (title) or reassign audio to another product",
|
|
371
373
|
|
|
372
374
|
inputSchema: {
|
|
@@ -388,7 +390,7 @@ export const updateAudioTool = {
|
|
|
388
390
|
},
|
|
389
391
|
newProductId: {
|
|
390
392
|
type: "string",
|
|
391
|
-
description: "
|
|
393
|
+
description: "Product to move the audio to (starts with 'pr'). Sent as a transfer, which keeps the fingerprint; the target must be in the same shop",
|
|
392
394
|
pattern: "^pr[a-zA-Z0-9]+$"
|
|
393
395
|
},
|
|
394
396
|
partnerId: {
|
|
@@ -398,8 +400,7 @@ export const updateAudioTool = {
|
|
|
398
400
|
},
|
|
399
401
|
privateKey: {
|
|
400
402
|
type: "string",
|
|
401
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
402
|
-
default: getPrivateKeySafe()
|
|
403
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
403
404
|
},
|
|
404
405
|
useSandbox: {
|
|
405
406
|
type: "boolean",
|
|
@@ -501,6 +502,7 @@ ${JSON.stringify(audio, null, 2)}
|
|
|
501
502
|
*/
|
|
502
503
|
export const deleteAudioTool = {
|
|
503
504
|
name: "payware_products_delete_audio",
|
|
505
|
+
annotations: CHANGES,
|
|
504
506
|
description: "Delete an audio file from a product. This action cannot be undone.",
|
|
505
507
|
|
|
506
508
|
inputSchema: {
|
|
@@ -522,8 +524,7 @@ export const deleteAudioTool = {
|
|
|
522
524
|
},
|
|
523
525
|
privateKey: {
|
|
524
526
|
type: "string",
|
|
525
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
526
|
-
default: getPrivateKeySafe()
|
|
527
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
527
528
|
},
|
|
528
529
|
useSandbox: {
|
|
529
530
|
type: "boolean",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createProduct } from '../../shared/products/products-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
3
|
import { PRODUCT_TYPES, OVERLAP_PRIORITY } from '../../shared/products/products-api.js';
|
|
4
|
+
import { CREATES } from '../../shared/tool-annotations.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Create product tool implementation for merchants
|
|
7
8
|
*/
|
|
8
9
|
export const createProductTool = {
|
|
9
10
|
name: "payware_products_create_product",
|
|
11
|
+
annotations: CREATES,
|
|
10
12
|
description: `Create a new product for inventory management and payment processing.
|
|
11
13
|
|
|
12
14
|
**Product Structure:**
|
|
@@ -134,8 +136,7 @@ export const createProductTool = {
|
|
|
134
136
|
},
|
|
135
137
|
privateKey: {
|
|
136
138
|
type: "string",
|
|
137
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
138
|
-
default: getPrivateKeySafe(true)
|
|
139
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
139
140
|
},
|
|
140
141
|
useSandbox: {
|
|
141
142
|
type: "boolean",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { deleteProduct } from '../../shared/products/products-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { CHANGES } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Delete product tool implementation for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const deleteProductTool = {
|
|
8
9
|
name: "payware_products_delete_product",
|
|
10
|
+
annotations: CHANGES,
|
|
9
11
|
description: "Delete a product from the merchant account. This action cannot be undone.",
|
|
10
12
|
|
|
11
13
|
inputSchema: {
|
|
@@ -23,8 +25,7 @@ export const deleteProductTool = {
|
|
|
23
25
|
},
|
|
24
26
|
privateKey: {
|
|
25
27
|
type: "string",
|
|
26
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
27
|
-
default: getPrivateKeySafe()
|
|
28
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
28
29
|
},
|
|
29
30
|
useSandbox: {
|
|
30
31
|
type: "boolean",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getProductImage } from '../../shared/products/products-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
3
|
import { IMAGE_TYPES, IMAGE_FORMATS, QR_ERROR_CORRECTION, BARCODE_LOCATIONS } from '../../shared/products/products-api.js';
|
|
4
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Get product image tool implementation for merchants
|
|
7
8
|
*/
|
|
8
9
|
export const getProductImageTool = {
|
|
9
10
|
name: "payware_products_get_product_image",
|
|
11
|
+
annotations: READS,
|
|
10
12
|
description: `Generate a QR code or barcode image for a product.
|
|
11
13
|
|
|
12
14
|
**QR Code Options:** Format, border, error correction, scale, version
|
|
@@ -102,8 +104,7 @@ export const getProductImageTool = {
|
|
|
102
104
|
},
|
|
103
105
|
privateKey: {
|
|
104
106
|
type: "string",
|
|
105
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
106
|
-
default: getPrivateKeySafe()
|
|
107
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
107
108
|
},
|
|
108
109
|
useSandbox: {
|
|
109
110
|
type: "boolean",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getProduct } from '../../shared/products/products-api.js';
|
|
2
2
|
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
+
import { READS } from '../../shared/tool-annotations.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Get product tool implementation for merchants
|
|
6
7
|
*/
|
|
7
8
|
export const getProductTool = {
|
|
8
9
|
name: "payware_products_get_product",
|
|
10
|
+
annotations: READS,
|
|
9
11
|
description: "Get detailed information about a specific product by ID",
|
|
10
12
|
|
|
11
13
|
inputSchema: {
|
|
@@ -23,8 +25,7 @@ export const getProductTool = {
|
|
|
23
25
|
},
|
|
24
26
|
privateKey: {
|
|
25
27
|
type: "string",
|
|
26
|
-
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
27
|
-
default: getPrivateKeySafe()
|
|
28
|
+
description: "RSA private key for authentication (uses environment-specific private key as default)"
|
|
28
29
|
},
|
|
29
30
|
useSandbox: {
|
|
30
31
|
type: "boolean",
|