@payware/mcp-server 1.5.1 → 2.0.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.
- 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/merchant/transactions/transaction-history.js +1 -1
- package/src/payment-institution/index.js +1 -9
- package/src/payment-institution/transactions/get-transaction-history.js +1 -2
- package/src/payment-institution/transactions/get-transaction-status.js +3 -4
- package/src/payment-institution/transactions/simulate-pi-callback.js +0 -9
- package/src/payment-institution/transactions/soundbite-transaction.js +1 -2
- 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
|
|
@@ -184,7 +184,7 @@ ${result.transaction.paymentMethod ? `- Payment Method: ${result.transaction.pay
|
|
|
184
184
|
|
|
185
185
|
**Parties:**
|
|
186
186
|
- Payee: ${result.transaction.payeeFriendlyName || 'N/A'} (${result.transaction.payeeAccount || 'N/A'})
|
|
187
|
-
- Payer: ${result.transaction.payerFriendlyName || 'N/A'}
|
|
187
|
+
- Payer: ${result.transaction.payerFriendlyName || 'N/A'}
|
|
188
188
|
- Payee BIC: ${result.transaction.payeeBIC || 'N/A'}
|
|
189
189
|
- Payer BIC: ${result.transaction.payerBIC || 'N/A'}
|
|
190
190
|
|
|
@@ -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,
|
|
@@ -68,7 +68,7 @@ export const getPITransactionHistoryTool = {
|
|
|
68
68
|
- Complete transaction details
|
|
69
69
|
- Final status (CONFIRMED, DECLINED, FAILED, EXPIRED)
|
|
70
70
|
- Status message (for failed/declined transactions)
|
|
71
|
-
- Payee
|
|
71
|
+
- Payee account, friendly names and BICs (payware does not keep the payer's account)
|
|
72
72
|
- Transaction amounts, currency, and timestamps
|
|
73
73
|
- Creation and processing timeline
|
|
74
74
|
|
|
@@ -170,7 +170,6 @@ ${tx.reasonL2 ? `- Reason L2: ${tx.reasonL2}` : ''}
|
|
|
170
170
|
- BIC: ${tx.payeeBIC || 'N/A'}
|
|
171
171
|
|
|
172
172
|
**Payer Information:**
|
|
173
|
-
- Account: ${tx.payerAccount || 'N/A'}
|
|
174
173
|
- Friendly Name: ${tx.payerFriendlyName || 'N/A'}
|
|
175
174
|
- BIC: ${tx.payerBIC || 'N/A'}
|
|
176
175
|
|
|
@@ -61,13 +61,13 @@ export const getPITransactionStatusTool = {
|
|
|
61
61
|
**Use Cases:**
|
|
62
62
|
- Check transaction status and details
|
|
63
63
|
- Monitor transaction progress
|
|
64
|
-
- Get participant information (payee
|
|
64
|
+
- Get participant information (payee account, friendly names, BICs)
|
|
65
65
|
- Check remaining time to live
|
|
66
66
|
- Fetch what to display to the payer for a product-originated transaction
|
|
67
67
|
|
|
68
68
|
**Response includes:**
|
|
69
69
|
- Transaction ID and type
|
|
70
|
-
- Payee
|
|
70
|
+
- Payee account, friendly names and BICs (payware does not keep the payer's account)
|
|
71
71
|
- Transaction amount and currency
|
|
72
72
|
- Reason lines and creation timestamp
|
|
73
73
|
- Remaining time to live
|
|
@@ -195,7 +195,6 @@ ${tx.reasonL2 ? `- Reason L2: ${tx.reasonL2}` : ''}
|
|
|
195
195
|
- BIC: ${tx.payeeBIC || 'N/A'}
|
|
196
196
|
|
|
197
197
|
**Payer Information:**
|
|
198
|
-
- Account: ${tx.payerAccount || 'N/A'}
|
|
199
198
|
- Friendly Name: ${tx.payerFriendlyName || 'N/A'}
|
|
200
199
|
- BIC: ${tx.payerBIC || 'N/A'}
|
|
201
200
|
|
|
@@ -210,7 +209,7 @@ ${JSON.stringify(result.transaction, null, 2)}
|
|
|
210
209
|
- Timestamp: ${result.timestamp}
|
|
211
210
|
|
|
212
211
|
**Next Steps:**
|
|
213
|
-
1.
|
|
212
|
+
1. Process it if your institution has not yet; once processed, finalize it
|
|
214
213
|
2. ${tx.timeToLive && parseInt(tx.timeToLive) < 60 ? '⚠️ Transaction expires soon!' : 'Monitor remaining TTL'}
|
|
215
214
|
3. Use \`payware_operations_process_transaction\` if you need to process this transaction
|
|
216
215
|
4. Use \`payware_operations_finalize_transaction\` to confirm/decline after processing
|
|
@@ -22,7 +22,6 @@ export function generateMockPICallback(transactionId, callbackType = 'TRANSACTIO
|
|
|
22
22
|
payeeAccount = 'M-1W-1account2',
|
|
23
23
|
payeeFriendlyName = 'payware',
|
|
24
24
|
payerBIC = 'SBBICID1',
|
|
25
|
-
payerAccount = 'payerAccount',
|
|
26
25
|
payerFriendlyName = 'Demo Financial Institution',
|
|
27
26
|
reasonL1 = '57',
|
|
28
27
|
reasonL2 = null,
|
|
@@ -81,7 +80,6 @@ export function generateMockPICallback(transactionId, callbackType = 'TRANSACTIO
|
|
|
81
80
|
payeeAccount,
|
|
82
81
|
payeeFriendlyName,
|
|
83
82
|
payerBIC,
|
|
84
|
-
payerAccount,
|
|
85
83
|
payerFriendlyName,
|
|
86
84
|
reasonL1,
|
|
87
85
|
...(reasonL2 && { reasonL2 }),
|
|
@@ -215,11 +213,6 @@ export const simulatePICallbackTool = {
|
|
|
215
213
|
description: "Payer's BIC code",
|
|
216
214
|
default: "SBBICID1"
|
|
217
215
|
},
|
|
218
|
-
payerAccount: {
|
|
219
|
-
type: "string",
|
|
220
|
-
description: "Payer account identifier",
|
|
221
|
-
default: "payerAccount"
|
|
222
|
-
},
|
|
223
216
|
payerFriendlyName: {
|
|
224
217
|
type: "string",
|
|
225
218
|
description: "Payer friendly name",
|
|
@@ -276,7 +269,6 @@ export const simulatePICallbackTool = {
|
|
|
276
269
|
payeeAccount = 'M-1W-1account2',
|
|
277
270
|
payeeFriendlyName = 'payware',
|
|
278
271
|
payerBIC = 'SBBICID1',
|
|
279
|
-
payerAccount = 'payerAccount',
|
|
280
272
|
payerFriendlyName = 'Demo Financial Institution',
|
|
281
273
|
reasonL1 = '57',
|
|
282
274
|
reasonL2,
|
|
@@ -302,7 +294,6 @@ export const simulatePICallbackTool = {
|
|
|
302
294
|
payeeAccount,
|
|
303
295
|
payeeFriendlyName,
|
|
304
296
|
payerBIC,
|
|
305
|
-
payerAccount,
|
|
306
297
|
payerFriendlyName,
|
|
307
298
|
reasonL1,
|
|
308
299
|
reasonL2,
|
|
@@ -177,7 +177,6 @@ ${tx.reasonL2 ? `- Reason L2: ${tx.reasonL2}` : ''}
|
|
|
177
177
|
- BIC: ${tx.payeeBIC || 'N/A'}
|
|
178
178
|
|
|
179
179
|
**Payer Information:**
|
|
180
|
-
- Account: ${tx.payerAccount || 'N/A'}
|
|
181
180
|
- Friendly Name: ${tx.payerFriendlyName || 'N/A'}
|
|
182
181
|
- BIC: ${tx.payerBIC || 'N/A'}
|
|
183
182
|
|
|
@@ -199,7 +198,7 @@ ${JSON.stringify(result.transaction, null, 2)}
|
|
|
199
198
|
**Next Steps:**
|
|
200
199
|
1. Transaction successfully identified from soundbite file
|
|
201
200
|
2. Use transaction ID: \`${tx.transactionId || 'N/A'}\` for further operations
|
|
202
|
-
3.
|
|
201
|
+
3. Process this transaction as the payer
|
|
203
202
|
4. Use \`payware_operations_process_transaction\` to process payment
|
|
204
203
|
5. Use \`payware_operations_finalize_transaction\` to confirm/decline
|
|
205
204
|
|
|
@@ -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
|