@payware/mcp-server 1.5.1 → 2.0.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 +1 -1
- package/README.md +1 -5
- package/package.json +1 -1
- package/src/config/toolsets.js +0 -2
- package/src/isv/index.js +0 -6
- package/src/isv/products/get-product.js +0 -1
- package/src/isv/transactions/create-transaction.js +1 -1
- package/src/merchant/index.js +0 -6
- package/src/merchant/products/get-product.js +0 -1
- package/src/payment-institution/index.js +1 -9
- package/src/shared/auth-headers.js +7 -6
- package/src/shared/placements/tools.js +4 -17
- package/src/tools/advanced-code-generator.js +2 -28
- package/src/utils/code-examples/common/helpers.js +1 -11
- package/src/utils/code-examples/index.js +1 -18
- package/src/isv/deep-links/delete-product-link.js +0 -155
- package/src/isv/deep-links/delete-transaction-link.js +0 -155
- package/src/isv/deep-links/get-product-link.js +0 -169
- package/src/isv/deep-links/get-transaction-link.js +0 -169
- package/src/isv/deep-links/index.js +0 -23
- package/src/merchant/deep-links/delete-product-link.js +0 -122
- package/src/merchant/deep-links/delete-transaction-link.js +0 -122
- package/src/merchant/deep-links/get-product-link.js +0 -136
- package/src/merchant/deep-links/get-transaction-link.js +0 -136
- package/src/merchant/deep-links/index.js +0 -23
- package/src/payment-institution/deep-links/delete-transaction-link.js +0 -129
- package/src/payment-institution/deep-links/get-transaction-link.js +0 -143
- package/src/payment-institution/deep-links/index.js +0 -17
- package/src/shared/deep-links/api.js +0 -215
- package/src/utils/code-examples/shared/deep-links.js +0 -662
package/.env.example
CHANGED
|
@@ -27,7 +27,7 @@ PAYWARE_SANDBOX_URL=https://sandbox.payware.eu/api
|
|
|
27
27
|
PAYWARE_PRODUCTION_URL=https://api.payware.eu/api
|
|
28
28
|
|
|
29
29
|
# Toolsets to load (Optional - unset loads every tool), comma-separated:
|
|
30
|
-
# auth, transactions, products, placements,
|
|
30
|
+
# auth, transactions, products, placements, data, logs, poi, shops, onboarding, utils
|
|
31
31
|
# PAYWARE_MCP_TOOLSETS=products,placements
|
|
32
32
|
|
|
33
33
|
# =============================================================================
|
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ Every tool definition goes into the assistant's context on every turn, and a mer
|
|
|
108
108
|
PAYWARE_MCP_TOOLSETS=products,placements
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Toolsets: `auth`, `transactions`, `products`, `placements`, `
|
|
111
|
+
Toolsets: `auth`, `transactions`, `products`, `placements`, `data`, `logs`, `poi`, `shops`, `onboarding`, `utils`. Unset, or `all`, loads every tool. An unknown name is ignored with a warning in the server log. A tool outside the chosen toolsets is neither listed nor callable; this narrows what the assistant is offered and does not change what your partner account may do. An ISV that obtains OAuth2 tokens through this server includes `auth`.
|
|
112
112
|
|
|
113
113
|
### 3. Start the MCP Server
|
|
114
114
|
|
|
@@ -232,7 +232,6 @@ Supports 60+ operations across all partner types:
|
|
|
232
232
|
- **Products**: create_product, get_product, update_product, delete_product, list_products, get_product_image, create_schedule, update_schedule, delete_schedule, list_schedules
|
|
233
233
|
- **OAuth2** (ISV only): obtain_token, get_token_info, create_token_simple, refresh_token, revoke_token, list_active_tokens
|
|
234
234
|
- **Data**: generate_report, get_report_status, export_report, download_export, cancel_report, list_reports, get_analytics_summary, create_custom_report
|
|
235
|
-
- **Deep Links**: get_transaction_link, get_product_link, create_custom_link, delete_transaction_link, delete_product_link, list_active_links, get_link_analytics, create_batch_links
|
|
236
235
|
- **P2P** (Payment Institution): initiate_p2p_transfer, accept_p2p_transfer, reject_p2p_transfer, get_p2p_transfer_status, list_p2p_transfers, cancel_p2p_transfer, create_p2p_link, get_p2p_analytics
|
|
237
236
|
- **Soundbites** (Payment Institution): register_audio, get_audio, update_audio, delete_audio, list_audios, create_soundbite_transaction, stream_audio, download_audio, get_soundbite_analytics, create_audio_playlist, get_audio_preview
|
|
238
237
|
|
|
@@ -385,9 +384,6 @@ Generate production-ready code examples for any payware operation.
|
|
|
385
384
|
- `initiate_p2p_transfer` - Initiate peer-to-peer transfer
|
|
386
385
|
- `accept_p2p_transfer` - Accept P2P transfer
|
|
387
386
|
|
|
388
|
-
**Deep Links (all partner types):**
|
|
389
|
-
- `get_transaction_link` - Get deep link for transaction
|
|
390
|
-
|
|
391
387
|
**Soundbites (payment_institution only):**
|
|
392
388
|
- `register_audio` - Register audio content for soundbite transactions
|
|
393
389
|
|
package/package.json
CHANGED
package/src/config/toolsets.js
CHANGED
|
@@ -21,7 +21,6 @@ export const TOOLSETS = {
|
|
|
21
21
|
transactions: 'Create, process, finalize, cancel and look up transactions, and simulate callbacks',
|
|
22
22
|
products: 'Products, price schedules, audio and product images',
|
|
23
23
|
placements: 'Campaigns, placements, airing rules and the airing calendar',
|
|
24
|
-
deep_links: 'Shareable links for transactions and products',
|
|
25
24
|
data: 'Reports and exports',
|
|
26
25
|
logs: 'API logs (Premium)',
|
|
27
26
|
poi: 'Points of interaction (ISV)',
|
|
@@ -35,7 +34,6 @@ const BY_PREFIX = [
|
|
|
35
34
|
['payware_authorization_', 'auth'],
|
|
36
35
|
['payware_operations_', 'transactions'],
|
|
37
36
|
['payware_products_', 'products'],
|
|
38
|
-
['payware_deep_links_', 'deep_links'],
|
|
39
37
|
['payware_data_', 'data'],
|
|
40
38
|
['payware_logs_', 'logs'],
|
|
41
39
|
['payware_poi_', 'poi'],
|
package/src/isv/index.js
CHANGED
|
@@ -23,7 +23,6 @@ import { isvDataTools } from './data/index.js';
|
|
|
23
23
|
import { isvProductTools } from './products/index.js';
|
|
24
24
|
|
|
25
25
|
// Deep links tools
|
|
26
|
-
import { isvDeepLinksTools } from './deep-links/index.js';
|
|
27
26
|
|
|
28
27
|
// POI tools
|
|
29
28
|
import { isvPOITools } from './poi/index.js';
|
|
@@ -68,7 +67,6 @@ export const isvTools = [
|
|
|
68
67
|
...isvProductTools,
|
|
69
68
|
|
|
70
69
|
// Deep links management
|
|
71
|
-
...isvDeepLinksTools,
|
|
72
70
|
|
|
73
71
|
// POI management
|
|
74
72
|
...isvPOITools,
|
|
@@ -118,10 +116,6 @@ export function getISVTools() {
|
|
|
118
116
|
else if (tool.name.startsWith('payware_products_')) {
|
|
119
117
|
newName = tool.name; // Keep products grouping
|
|
120
118
|
}
|
|
121
|
-
// Deep links tools keep their deep_links grouping
|
|
122
|
-
else if (tool.name.startsWith('payware_deep_links_')) {
|
|
123
|
-
newName = tool.name; // Keep deep_links grouping
|
|
124
|
-
}
|
|
125
119
|
// POI tools keep their poi grouping
|
|
126
120
|
else if (tool.name.startsWith('payware_poi_')) {
|
|
127
121
|
newName = tool.name; // Keep poi grouping
|
|
@@ -119,7 +119,6 @@ ${product.upc ? `- UPC: ${product.upc}` : ''}
|
|
|
119
119
|
${product.imageUrl ? `- Image: ${product.imageUrl}` : ''}
|
|
120
120
|
${product.termsUrl ? `- Terms URL: ${product.termsUrl}` : ''}
|
|
121
121
|
${product.termsText ? `- Terms Text: ${product.termsText.substring(0, 100)}${product.termsText.length > 100 ? '...' : ''}` : ''}
|
|
122
|
-
${product.deepLink && product.deepLink !== '-' ? `- Deep Link: ${product.deepLink}` : ''}
|
|
123
122
|
|
|
124
123
|
**ISV Integration Details:**
|
|
125
124
|
- ISV Partner: ${isvPartnerId}
|
|
@@ -164,7 +164,7 @@ it acts for, so this endpoint answers **403** (\`ERR_METHOD_NOT_ALLOWED_FOR_CURR
|
|
|
164
164
|
that merchant is on **Basic**. Acting on behalf is no longer sufficient on its own - before
|
|
165
165
|
2026-08-21 it was, and an ISV serving a Basic merchant could reach the transaction, product, shop and
|
|
166
166
|
report APIs regardless of that merchant's plan. The same applies to
|
|
167
|
-
\`payware_products_
|
|
167
|
+
\`payware_products_*\` and \`payware_data_*\`. If a call that used to work
|
|
168
168
|
now returns 403, check the merchant's plan first.
|
|
169
169
|
|
|
170
170
|
⚠️ **Shop scope.** An ISV reaches only the shops the merchant assigned it. Naming any other shop
|
package/src/merchant/index.js
CHANGED
|
@@ -18,7 +18,6 @@ import { merchantDataTools } from './data/index.js';
|
|
|
18
18
|
import { merchantProductTools } from './products/index.js';
|
|
19
19
|
|
|
20
20
|
// Deep links tools
|
|
21
|
-
import { merchantDeepLinksTools } from './deep-links/index.js';
|
|
22
21
|
|
|
23
22
|
// Logs tools (Premium feature)
|
|
24
23
|
import { merchantLogsTools } from './logs/index.js';
|
|
@@ -57,7 +56,6 @@ export const merchantTools = [
|
|
|
57
56
|
...merchantProductTools,
|
|
58
57
|
|
|
59
58
|
// Deep links management
|
|
60
|
-
...merchantDeepLinksTools,
|
|
61
59
|
|
|
62
60
|
// Logs management (Premium feature)
|
|
63
61
|
...merchantLogsTools,
|
|
@@ -97,10 +95,6 @@ export function getMerchantTools() {
|
|
|
97
95
|
else if (tool.name.startsWith('payware_products_')) {
|
|
98
96
|
newName = tool.name; // Keep products grouping
|
|
99
97
|
}
|
|
100
|
-
// Deep links tools keep their deep_links grouping
|
|
101
|
-
else if (tool.name.startsWith('payware_deep_links_')) {
|
|
102
|
-
newName = tool.name; // Keep deep_links grouping
|
|
103
|
-
}
|
|
104
98
|
// Logs tools keep their logs grouping
|
|
105
99
|
else if (tool.name.startsWith('payware_logs_')) {
|
|
106
100
|
newName = tool.name; // Keep logs grouping
|
|
@@ -104,7 +104,6 @@ ${product.upc ? `- UPC: ${product.upc}` : ''}
|
|
|
104
104
|
${product.imageUrl ? `- Image: ${product.imageUrl}` : ''}
|
|
105
105
|
${product.termsUrl ? `- Terms URL: ${product.termsUrl}` : ''}
|
|
106
106
|
${product.termsText ? `- Terms Text: ${product.termsText.substring(0, 100)}${product.termsText.length > 100 ? '...' : ''}` : ''}
|
|
107
|
-
${product.deepLink && product.deepLink !== '-' ? `- Deep Link: ${product.deepLink}` : ''}
|
|
108
107
|
|
|
109
108
|
**API Response:**
|
|
110
109
|
\`\`\`json
|
|
@@ -26,7 +26,6 @@ import { simulatePICallbackTool } from './transactions/simulate-pi-callback.js';
|
|
|
26
26
|
import { paymentInstitutionDataTools } from './data/index.js';
|
|
27
27
|
|
|
28
28
|
// Deep links tools
|
|
29
|
-
import { paymentInstitutionDeepLinksTools } from './deep-links/index.js';
|
|
30
29
|
|
|
31
30
|
// Import shared tools
|
|
32
31
|
import { sharedTools } from '../shared/index.js';
|
|
@@ -49,10 +48,7 @@ export const paymentInstitutionTools = [
|
|
|
49
48
|
simulatePICallbackTool,
|
|
50
49
|
|
|
51
50
|
// Data management
|
|
52
|
-
...paymentInstitutionDataTools
|
|
53
|
-
|
|
54
|
-
// Deep links management
|
|
55
|
-
...paymentInstitutionDeepLinksTools
|
|
51
|
+
...paymentInstitutionDataTools
|
|
56
52
|
];
|
|
57
53
|
|
|
58
54
|
/**
|
|
@@ -79,10 +75,6 @@ export function getPaymentInstitutionTools() {
|
|
|
79
75
|
else if (tool.name.startsWith('payware_data_')) {
|
|
80
76
|
newName = tool.name; // Keep data grouping
|
|
81
77
|
}
|
|
82
|
-
// Deep links tools keep their deep_links grouping
|
|
83
|
-
else if (tool.name.startsWith('payware_deep_links_')) {
|
|
84
|
-
newName = tool.name; // Keep deep_links grouping
|
|
85
|
-
}
|
|
86
78
|
|
|
87
79
|
return {
|
|
88
80
|
...tool,
|
|
@@ -8,13 +8,14 @@ import { createJWTForPartner } from '../core/auth/jwt-factory.js';
|
|
|
8
8
|
* but adds the merchant it is acting for in the `aud` claim and that merchant's OAuth2 token in
|
|
9
9
|
* `sub` - which is what makes the call an on-behalf call rather than an ISV-for-itself call.
|
|
10
10
|
*
|
|
11
|
-
* **Note on duplication.**
|
|
12
|
-
* `shared/products/products-api.js`, `shared/data/data-api.js
|
|
13
|
-
*
|
|
11
|
+
* **Note on duplication.** Three near-identical private copies of this function exist, in
|
|
12
|
+
* `shared/products/products-api.js`, `shared/data/data-api.js` and `shared/logs/logs-api.js` (a
|
|
13
|
+
* fourth, in the deep-links tools, went with them). This is the shared one, used by everything added
|
|
14
|
+
* since. The three were
|
|
14
15
|
* deliberately left alone rather than swept into it: they are on live, working paths, they differ in
|
|
15
|
-
* small ways that look accidental but have not been proven so (deep-links
|
|
16
|
-
* `''` where the others pass `undefined`, and for a GET those are not always the
|
|
17
|
-
* hash calculation), and consolidating them is a refactor of authentication with no test suite
|
|
16
|
+
* small ways that look accidental but have not been proven so (the removed deep-links copy defaulted
|
|
17
|
+
* `requestBody` to `''` where the others pass `undefined`, and for a GET those are not always the
|
|
18
|
+
* same thing to a hash calculation), and consolidating them is a refactor of authentication with no test suite
|
|
18
19
|
* behind it. Do it as its own change, with the `''`-vs-`undefined` question answered first, not as a
|
|
19
20
|
* side effect of adding a tool.
|
|
20
21
|
*
|
|
@@ -319,7 +319,7 @@ const SPECS = [
|
|
|
319
319
|
name: 'payware_products_create_placement',
|
|
320
320
|
annotations: CREATES,
|
|
321
321
|
title: 'Placement created',
|
|
322
|
-
description: 'Create a placement for a product; up to 1,000 per product. The response carries its placementId, which goes on the medium wherever the product ID would: a QR code (payware
|
|
322
|
+
description: 'Create a placement for a product; up to 1,000 per product. The response carries its placementId, which goes on the medium wherever the product ID would: a QR code (its payware link, or payware:{placementId}), an NFC tag, a BLE beacon, a link, a barcode or an SMS. A bank resolving it pays for the product, and the payment is attributed to the placement. For a SOUNDBITE carrier, add airing rules so taps during the airing are attributed.\n\n**Endpoint:** POST /products/{productId}/placements (PRM plan)',
|
|
323
323
|
properties: { productId: PRODUCT_ID, ...PLACEMENT_FIELDS },
|
|
324
324
|
required: ['productId', 'name', 'medium', 'carriers'],
|
|
325
325
|
request: (a) => ({ method: 'POST', path: `/products/${enc(a.productId)}/placements`, body: pick(a, PLACEMENT_FIELDS) })
|
|
@@ -350,17 +350,17 @@ const SPECS = [
|
|
|
350
350
|
name: 'payware_products_delete_placement',
|
|
351
351
|
annotations: CHANGES,
|
|
352
352
|
title: 'Placement deleted',
|
|
353
|
-
description: 'Delete a placement. **Its printed codes
|
|
353
|
+
description: 'Delete a placement. **Its printed codes and its payware link stop resolving**, and its ID is never reused. To stop airing and attribution but keep printed codes working, replace it with active false instead.\n\n**Endpoint:** DELETE /products/{productId}/placements/{placementId} (PRM plan)',
|
|
354
354
|
properties: { productId: PRODUCT_ID, placementId: PLACEMENT_ID },
|
|
355
355
|
required: ['productId', 'placementId'],
|
|
356
356
|
request: (a) => ({ method: 'DELETE', path: `/products/${enc(a.productId)}/placements/${enc(a.placementId)}` }),
|
|
357
|
-
present: (r, a) => [{ type: 'text', text: `Placement ${a.placementId} deleted. Its codes
|
|
357
|
+
present: (r, a) => [{ type: 'text', text: `Placement ${a.placementId} deleted. Its codes and payware link no longer resolve.` }]
|
|
358
358
|
},
|
|
359
359
|
{
|
|
360
360
|
name: 'payware_products_get_placement_image',
|
|
361
361
|
annotations: READS,
|
|
362
362
|
title: 'Placement image',
|
|
363
|
-
description: 'A placement\'s QR code (carrying payware://{placementId}) or Code 128 barcode (carrying the plain ID), for print. PNG and JPG come back as an image, SVG as its markup.\n\n**Endpoint:** GET /products/{productId}/placements/{placementId}/image',
|
|
363
|
+
description: 'A placement\'s QR code (carrying the placement\'s payware link, https://go.payware.eu/{placementId}, which needs no API call) or Code 128 barcode (carrying the plain ID), for print. PNG and JPG come back as an image, SVG as its markup.\n\n**Endpoint:** GET /products/{productId}/placements/{placementId}/image',
|
|
364
364
|
properties: {
|
|
365
365
|
productId: PRODUCT_ID,
|
|
366
366
|
placementId: PLACEMENT_ID,
|
|
@@ -376,19 +376,6 @@ const SPECS = [
|
|
|
376
376
|
}),
|
|
377
377
|
present: (r, a) => image(a.placementId, r)
|
|
378
378
|
},
|
|
379
|
-
{
|
|
380
|
-
name: 'payware_products_get_placement_link',
|
|
381
|
-
annotations: ADDS,
|
|
382
|
-
title: 'Placement link',
|
|
383
|
-
description: 'A placement\'s short link, https://go.payware.eu/{placementId}, made on the first request and the same afterwards. On a phone it opens payware:/{placementId} in the payment app; a payment through it is attributed to the placement.\n\n**Endpoint:** GET /products/{productId}/placements/{placementId}/link (PRM plan)',
|
|
384
|
-
properties: { productId: PRODUCT_ID, placementId: PLACEMENT_ID },
|
|
385
|
-
required: ['productId', 'placementId'],
|
|
386
|
-
request: (a) => ({ method: 'GET', path: `/products/${enc(a.productId)}/placements/${enc(a.placementId)}/link` }),
|
|
387
|
-
present: (r, a) => [{
|
|
388
|
-
type: 'text',
|
|
389
|
-
text: `Short link of placement ${a.placementId}:\n\n${typeof r.data === 'string' ? r.data : JSON.stringify(r.data)}`
|
|
390
|
-
}]
|
|
391
|
-
},
|
|
392
379
|
{
|
|
393
380
|
name: 'payware_products_get_placement_stats',
|
|
394
381
|
annotations: READS,
|
|
@@ -191,20 +191,6 @@ class AdvancedCodeGenerator {
|
|
|
191
191
|
},
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
// Deep links
|
|
195
|
-
get_transaction_link: {
|
|
196
|
-
description: 'Get deep link for transaction',
|
|
197
|
-
endpoint: '/deeplinks/transactions/{id}',
|
|
198
|
-
method: 'GET',
|
|
199
|
-
partnerTypes: ['merchant', 'isv', 'payment_institution'],
|
|
200
|
-
sampleBody: null,
|
|
201
|
-
queryParams: {
|
|
202
|
-
type: 'QR_CODE',
|
|
203
|
-
format: 'PNG',
|
|
204
|
-
size: '256x256'
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
|
|
208
194
|
// Soundbites (Payment Institution only)
|
|
209
195
|
register_audio: {
|
|
210
196
|
description: 'Register audio file for a product',
|
|
@@ -663,7 +649,6 @@ ${operation.replace('-', '_')}Example()
|
|
|
663
649
|
if (operation.includes('product')) return 'products';
|
|
664
650
|
if (operation.includes('token')) return 'oauth2';
|
|
665
651
|
if (operation.includes('report')) return 'data';
|
|
666
|
-
if (operation.includes('link')) return 'deeplinks';
|
|
667
652
|
if (operation.includes('audio') || operation.includes('soundbite')) return 'soundbites';
|
|
668
653
|
return 'misc';
|
|
669
654
|
}
|
|
@@ -1509,15 +1494,6 @@ echo "✅ Request completed"`;
|
|
|
1509
1494
|
go: 'fmt.Printf("Transaction ID: %s\\n", responseBody)',
|
|
1510
1495
|
ruby: 'puts "Transaction ID: #{response.body}"',
|
|
1511
1496
|
php: 'echo "Transaction ID: " . $result[\'transactionId\'] . "\\n";'
|
|
1512
|
-
},
|
|
1513
|
-
get_transaction_link: {
|
|
1514
|
-
java: 'System.out.println("Deep link URL: " + response.body());',
|
|
1515
|
-
nodejs: 'console.log("Deep link URL:", result.deepLinkUrl);',
|
|
1516
|
-
python: 'print(f"Deep link URL: {result[\'deepLinkUrl\']}")',
|
|
1517
|
-
csharp: 'Console.WriteLine($"Deep link URL: {responseContent}");',
|
|
1518
|
-
go: 'fmt.Printf("Deep link URL: %s\\n", responseBody)',
|
|
1519
|
-
ruby: 'puts "Deep link URL: #{result[\'deepLinkUrl\']}"',
|
|
1520
|
-
php: 'echo "Deep link URL: " . $result[\'deepLinkUrl\'] . "\\n";'
|
|
1521
1497
|
}
|
|
1522
1498
|
};
|
|
1523
1499
|
|
|
@@ -1744,7 +1720,7 @@ export const generateCodeExampleTool = {
|
|
|
1744
1720
|
properties: {
|
|
1745
1721
|
operation: {
|
|
1746
1722
|
type: 'string',
|
|
1747
|
-
description: 'payware API operation to generate code for. Categories: AUTHENTICATION (authentication), TRANSACTIONS (create_transaction, get_transaction_status, process_transaction, cancel_transaction, get_transaction_history), PRODUCTS - merchant/ISV only (create_product, get_product, list_products, update_product, delete_product), OAUTH2 - ISV only (obtain_token, get_token_info), REPORTS (generate_report, get_report_status, export_report),
|
|
1723
|
+
description: 'payware API operation to generate code for. Categories: AUTHENTICATION (authentication), TRANSACTIONS (create_transaction, get_transaction_status, process_transaction, cancel_transaction, get_transaction_history), PRODUCTS - merchant/ISV only (create_product, get_product, list_products, update_product, delete_product), OAUTH2 - ISV only (obtain_token, get_token_info), REPORTS (generate_report, get_report_status, export_report), AUDIO/SOUNDBITES - merchant/ISV only (register_audio, get_audios, get_audio, update_audio, delete_audio)',
|
|
1748
1724
|
enum: [
|
|
1749
1725
|
'authentication',
|
|
1750
1726
|
'create_transaction',
|
|
@@ -1762,8 +1738,6 @@ export const generateCodeExampleTool = {
|
|
|
1762
1738
|
'generate_report',
|
|
1763
1739
|
'get_report_status',
|
|
1764
1740
|
'export_report',
|
|
1765
|
-
'get_transaction_link',
|
|
1766
|
-
'get_product_link',
|
|
1767
1741
|
'register_audio',
|
|
1768
1742
|
'get_audios',
|
|
1769
1743
|
'get_audio',
|
|
@@ -1778,7 +1752,7 @@ export const generateCodeExampleTool = {
|
|
|
1778
1752
|
},
|
|
1779
1753
|
partner_type: {
|
|
1780
1754
|
type: 'string',
|
|
1781
|
-
description: 'payware partner type determines available operations. merchant: transactions, products, reports
|
|
1755
|
+
description: 'payware partner type determines available operations. merchant: transactions, products, reports. isv: all merchant operations plus OAuth2 token management for multiple merchants. payment_institution: transactions, advanced settlement features.',
|
|
1782
1756
|
enum: ['merchant', 'isv', 'payment_institution']
|
|
1783
1757
|
},
|
|
1784
1758
|
include_comments: {
|
|
@@ -170,12 +170,6 @@ export const CommonTemplates = {
|
|
|
170
170
|
download_export: '/data/exports/{id}',
|
|
171
171
|
cancel_report: '/data/reports/{id}',
|
|
172
172
|
|
|
173
|
-
// Deep link endpoints
|
|
174
|
-
get_transaction_link: '/deeplinks/transactions/{id}',
|
|
175
|
-
get_product_link: '/deeplinks/products/{id}',
|
|
176
|
-
delete_transaction_link: '/deeplinks/transactions/{id}',
|
|
177
|
-
delete_product_link: '/deeplinks/products/{id}',
|
|
178
|
-
|
|
179
173
|
// OAuth2 endpoints (ISV only). Plural /tokens, and served from the host root rather than
|
|
180
174
|
// under /api. The singular paths that used to be listed here - /oauth2/token,
|
|
181
175
|
// /oauth2/token/info, /oauth2/token/simple - do not exist on any payware environment.
|
|
@@ -214,8 +208,6 @@ export const CommonTemplates = {
|
|
|
214
208
|
list_audios: 'GET',
|
|
215
209
|
get_report_status: 'GET',
|
|
216
210
|
download_export: 'GET',
|
|
217
|
-
get_transaction_link: 'GET',
|
|
218
|
-
get_product_link: 'GET',
|
|
219
211
|
get_token_info: 'GET',
|
|
220
212
|
get_pi_transaction_status: 'GET',
|
|
221
213
|
get_pi_transaction_history: 'GET',
|
|
@@ -247,9 +239,7 @@ export const CommonTemplates = {
|
|
|
247
239
|
delete_product: 'DELETE',
|
|
248
240
|
delete_schedule: 'DELETE',
|
|
249
241
|
delete_audio: 'DELETE',
|
|
250
|
-
cancel_report: 'DELETE'
|
|
251
|
-
delete_transaction_link: 'DELETE',
|
|
252
|
-
delete_product_link: 'DELETE'
|
|
242
|
+
cancel_report: 'DELETE'
|
|
253
243
|
};
|
|
254
244
|
|
|
255
245
|
return methods[operation] || 'POST';
|
|
@@ -71,12 +71,6 @@ export {
|
|
|
71
71
|
generateDataExample
|
|
72
72
|
} from './shared/data.js';
|
|
73
73
|
|
|
74
|
-
export {
|
|
75
|
-
DeepLinkOperations,
|
|
76
|
-
DeepLinksGenerators,
|
|
77
|
-
generateDeepLinksExample
|
|
78
|
-
} from './shared/deep-links.js';
|
|
79
|
-
|
|
80
74
|
// P2P operations removed - P2P transfers are regular transactions
|
|
81
75
|
// where the receiving party is a payment institution customer
|
|
82
76
|
|
|
@@ -134,13 +128,6 @@ export class PaywareMCPGenerator {
|
|
|
134
128
|
'cancel_report', 'list_reports', 'get_analytics_summary', 'create_custom_report'
|
|
135
129
|
],
|
|
136
130
|
|
|
137
|
-
// Deep links
|
|
138
|
-
deeplinks: [
|
|
139
|
-
'get_transaction_link', 'get_product_link', 'create_custom_link',
|
|
140
|
-
'delete_transaction_link', 'delete_product_link', 'list_active_links',
|
|
141
|
-
'get_link_analytics', 'create_batch_links'
|
|
142
|
-
],
|
|
143
|
-
|
|
144
131
|
|
|
145
132
|
// Soundbites
|
|
146
133
|
soundbites: [
|
|
@@ -180,9 +167,6 @@ export class PaywareMCPGenerator {
|
|
|
180
167
|
case 'data':
|
|
181
168
|
return generateDataExample(operation, language, partnerType, options);
|
|
182
169
|
|
|
183
|
-
case 'deeplinks':
|
|
184
|
-
return generateDeepLinksExample(operation, language, partnerType, options);
|
|
185
|
-
|
|
186
170
|
|
|
187
171
|
case 'soundbites':
|
|
188
172
|
return generateSoundbitesExample(operation, language, partnerType, options);
|
|
@@ -263,8 +247,7 @@ export class PaywareMCPGenerator {
|
|
|
263
247
|
const available = {
|
|
264
248
|
auth: ['authentication'],
|
|
265
249
|
transactions: this.operations.transactions,
|
|
266
|
-
data: this.operations.data
|
|
267
|
-
deeplinks: this.operations.deeplinks
|
|
250
|
+
data: this.operations.data
|
|
268
251
|
};
|
|
269
252
|
|
|
270
253
|
// Add partner-specific operations
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { deleteProductDeepLink } from '../../shared/deep-links/api.js';
|
|
2
|
-
import { getPartnerIdSafe, getPrivateKeySafe } from '../../config/env.js';
|
|
3
|
-
import { CHANGES } from '../../shared/tool-annotations.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Delete deep link for a product (ISV on behalf of merchant)
|
|
7
|
-
*/
|
|
8
|
-
export const deleteProductLinkTool = {
|
|
9
|
-
name: "payware_deep_links_delete_product_link",
|
|
10
|
-
annotations: CHANGES,
|
|
11
|
-
description: `Delete an active deep link for a product on behalf of a merchant. Once deleted, the deep link URL will no longer redirect to the payware mobile app.
|
|
12
|
-
|
|
13
|
-
**ISV Authentication:**
|
|
14
|
-
- Requires ISV JWT token with merchant partner ID in 'aud' claim
|
|
15
|
-
- Requires OAuth2 token in 'sub' claim
|
|
16
|
-
|
|
17
|
-
**Use Cases:**
|
|
18
|
-
- Remove expired product links
|
|
19
|
-
- Clean up after product removal
|
|
20
|
-
- Security cleanup for discontinued products
|
|
21
|
-
|
|
22
|
-
**Important Notes:**
|
|
23
|
-
- Deep links are only supported in production environment
|
|
24
|
-
- Once deleted, the link cannot be recovered - you'll need to create a new one
|
|
25
|
-
- This operation is irreversible`,
|
|
26
|
-
|
|
27
|
-
inputSchema: {
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
productId: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "The product identifier (e.g., 'pr7e4rCToG')",
|
|
33
|
-
pattern: "^[a-zA-Z0-9]+$"
|
|
34
|
-
},
|
|
35
|
-
merchantPartnerId: {
|
|
36
|
-
type: "string",
|
|
37
|
-
description: "Partner ID of the merchant for whom the product is being deleted"
|
|
38
|
-
},
|
|
39
|
-
oauth2Token: {
|
|
40
|
-
type: "string",
|
|
41
|
-
description: "OAuth2 access token for merchant authorization"
|
|
42
|
-
},
|
|
43
|
-
isvPartnerId: {
|
|
44
|
-
type: "string",
|
|
45
|
-
description: "ISV Partner ID from payware dashboard. Uses PAYWARE_PARTNER_ID env var as default.",
|
|
46
|
-
default: getPartnerIdSafe()
|
|
47
|
-
},
|
|
48
|
-
privateKey: {
|
|
49
|
-
type: "string",
|
|
50
|
-
description: "ISV RSA private key for JWT token creation. Uses environment-specific private key as default."
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
required: ["productId", "merchantPartnerId", "oauth2Token"]
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
async handler(args) {
|
|
57
|
-
const {
|
|
58
|
-
productId,
|
|
59
|
-
merchantPartnerId,
|
|
60
|
-
oauth2Token,
|
|
61
|
-
isvPartnerId = getPartnerIdSafe(),
|
|
62
|
-
privateKey = getPrivateKeySafe()
|
|
63
|
-
} = args;
|
|
64
|
-
|
|
65
|
-
if (!productId) {
|
|
66
|
-
throw new Error("productId is required");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (!merchantPartnerId) {
|
|
70
|
-
throw new Error("merchantPartnerId is required for ISV operations");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!oauth2Token) {
|
|
74
|
-
throw new Error("oauth2Token is required for ISV operations");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!isvPartnerId) {
|
|
78
|
-
throw new Error("ISV Partner ID is required. Provide via 'isvPartnerId' parameter or set PAYWARE_PARTNER_ID environment variable.");
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!privateKey) {
|
|
82
|
-
throw new Error("Private key is required. Provide via 'privateKey' parameter or set PAYWARE_PRIVATE_KEY environment variable.");
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
const result = await deleteProductDeepLink({
|
|
87
|
-
productId,
|
|
88
|
-
partnerType: 'isv',
|
|
89
|
-
isvPartnerId,
|
|
90
|
-
privateKey,
|
|
91
|
-
merchantPartnerId,
|
|
92
|
-
oauth2Token
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
content: [{
|
|
97
|
-
type: "text",
|
|
98
|
-
text: `✅ **Product Deep Link Deleted (ISV)**
|
|
99
|
-
|
|
100
|
-
**Deletion Details:**
|
|
101
|
-
- Product ID: ${productId}
|
|
102
|
-
- Merchant: ${merchantPartnerId}
|
|
103
|
-
- Status: Successfully deleted
|
|
104
|
-
- Link URL: https://go.payware.eu/${productId} (now inactive)
|
|
105
|
-
|
|
106
|
-
**ISV Authentication:**
|
|
107
|
-
- ISV Partner ID: ${isvPartnerId}
|
|
108
|
-
- Merchant Partner ID: ${merchantPartnerId}
|
|
109
|
-
- OAuth2 Token: ${oauth2Token.substring(0, 10)}...
|
|
110
|
-
|
|
111
|
-
**API Call Details:**
|
|
112
|
-
- Endpoint: DELETE ${result.requestInfo.url}
|
|
113
|
-
- Status: ${result.requestInfo.statusCode}
|
|
114
|
-
- Method: ${result.requestInfo.method}
|
|
115
|
-
|
|
116
|
-
**Result:**
|
|
117
|
-
- The deep link is no longer active
|
|
118
|
-
- Mobile redirects will no longer work
|
|
119
|
-
- URL will return an error if accessed
|
|
120
|
-
|
|
121
|
-
**Important Notes:**
|
|
122
|
-
⚠️ This operation is irreversible
|
|
123
|
-
⚠️ Create a new link if needed using \`payware_deep_links_get_product_link\`
|
|
124
|
-
⚠️ Any existing shared links will stop working immediately`
|
|
125
|
-
}]
|
|
126
|
-
};
|
|
127
|
-
} catch (error) {
|
|
128
|
-
return {
|
|
129
|
-
content: [{
|
|
130
|
-
type: "text",
|
|
131
|
-
text: `❌ **Failed to Delete Product Deep Link (ISV)**
|
|
132
|
-
|
|
133
|
-
**Error Details:**
|
|
134
|
-
- Product ID: ${productId}
|
|
135
|
-
- Merchant: ${merchantPartnerId}
|
|
136
|
-
- Message: ${error.message}
|
|
137
|
-
|
|
138
|
-
**Common Issues:**
|
|
139
|
-
1. **Link not found**: Deep link may already be deleted or never existed
|
|
140
|
-
2. **Authentication failed**: Verify ISV partner ID, private key, and OAuth2 token
|
|
141
|
-
3. **Authorization failed**: Ensure OAuth2 token authorizes access to merchant
|
|
142
|
-
4. **Sandbox environment**: Deep links are production-only
|
|
143
|
-
5. **Invalid product ID**: Ensure product ID format is correct
|
|
144
|
-
|
|
145
|
-
**Troubleshooting:**
|
|
146
|
-
1. Check if deep link exists using \`payware_deep_links_get_product_link\`
|
|
147
|
-
2. Check OAuth2 token is valid and not expired
|
|
148
|
-
3. Ensure ISV has permission to access merchant data
|
|
149
|
-
4. Verify running in production environment
|
|
150
|
-
5. Ensure JWT authentication is working`
|
|
151
|
-
}]
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|