@payware/mcp-server 1.2.0 → 1.3.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/README.md +5 -0
- package/package.json +69 -66
- package/src/auth/sandbox-setup.js +186 -186
- package/src/isv/index.js +29 -1
- package/src/isv/invitations/index.js +471 -0
- package/src/isv/oauth2/obtain-token.js +19 -8
- package/src/isv/oauth2/token-helper.js +5 -2
- package/src/isv/poi/cancel-price.js +2 -10
- package/src/isv/poi/create.js +19 -0
- package/src/isv/poi/get-poi.js +2 -10
- package/src/isv/poi/get-qrcode.js +2 -10
- package/src/isv/poi/get-status.js +2 -10
- package/src/isv/poi/index.js +5 -0
- package/src/isv/poi/list-pois.js +2 -10
- package/src/isv/poi/set-price.js +217 -225
- package/src/isv/products/create-product.js +313 -313
- package/src/isv/products/update-product.js +264 -264
- package/src/isv/reference/index.js +249 -0
- package/src/isv/shops/index.js +22 -0
- package/src/isv/transactions/cancel-transaction.js +41 -10
- package/src/isv/transactions/create-transaction.js +20 -4
- package/src/isv/transactions/get-status.js +18 -11
- package/src/isv/transactions/process-transaction.js +160 -42
- package/src/isv/transactions/simulate-callback.js +128 -109
- package/src/isv/transactions/transaction-history.js +86 -90
- package/src/merchant/data/generate-report.js +19 -1
- package/src/merchant/index.js +21 -1
- package/src/merchant/logs/index.js +366 -0
- package/src/merchant/products/create-product.js +287 -287
- package/src/merchant/products/update-product.js +281 -281
- package/src/merchant/shops/index.js +18 -0
- package/src/merchant/transactions/cancel-transaction.js +10 -13
- package/src/merchant/transactions/create-transaction.js +88 -8
- package/src/merchant/transactions/get-status.js +40 -11
- package/src/merchant/transactions/process-transaction.js +2 -10
- package/src/merchant/transactions/simulate-callback.js +68 -9
- package/src/merchant/transactions/transaction-history.js +275 -257
- package/src/payment-institution/transactions/create-pi-transaction.js +2 -10
- package/src/payment-institution/transactions/finalize-transaction.js +333 -340
- package/src/payment-institution/transactions/get-transaction-history.js +2 -10
- package/src/payment-institution/transactions/get-transaction-status.js +38 -11
- package/src/payment-institution/transactions/process-pi-transaction.js +2 -10
- package/src/payment-institution/transactions/simulate-pi-callback.js +49 -9
- package/src/payment-institution/transactions/soundbite-transaction.js +2 -10
- package/src/shared/api-errors.js +188 -0
- package/src/shared/auth-headers.js +62 -0
- package/src/shared/data/data-api.js +11 -10
- package/src/shared/deep-links/api.js +5 -4
- package/src/shared/logs/logs-api.js +242 -0
- package/src/shared/poi/poi-create-api.js +419 -0
- package/src/shared/products/products-api.js +17 -16
- package/src/shared/shops/shops-api.js +155 -0
- package/src/tools/advanced-code-generator.js +2255 -2246
- package/src/utils/code-examples/common/auth-examples.js +1484 -1481
- package/src/utils/code-examples/common/helpers.js +7 -4
- package/src/utils/code-examples/isv/oauth2.js +458 -600
- package/src/utils/code-examples/isv/transactions.js +815 -812
- package/MCP-SETUP.md +0 -190
package/MCP-SETUP.md
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
# payware MCP Server Configuration
|
|
2
|
-
|
|
3
|
-
This document explains how to configure the payware MCP server for use with Claude Code or other MCP clients.
|
|
4
|
-
|
|
5
|
-
## Configuration Files
|
|
6
|
-
|
|
7
|
-
### 1. `mcp-config.json` - Simple Configuration
|
|
8
|
-
Basic MCP server configuration for Claude Code:
|
|
9
|
-
|
|
10
|
-
```json
|
|
11
|
-
{
|
|
12
|
-
"mcpServers": {
|
|
13
|
-
"payware": {
|
|
14
|
-
"command": "node",
|
|
15
|
-
"args": ["src/index.js"],
|
|
16
|
-
"cwd": "."
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### 2. `payware-mcp-config.json` - Production Configuration
|
|
23
|
-
Enhanced configuration with environment variables:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"mcpServers": {
|
|
28
|
-
"payware": {
|
|
29
|
-
"command": "node",
|
|
30
|
-
"args": ["src/index.js"],
|
|
31
|
-
"cwd": "/mnt/d/git/payware/mcp",
|
|
32
|
-
"env": {
|
|
33
|
-
"NODE_ENV": "production"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 3. `claude-code-config.json` - Full Documentation
|
|
41
|
-
Complete configuration with metadata and documentation.
|
|
42
|
-
|
|
43
|
-
## Setup Instructions
|
|
44
|
-
|
|
45
|
-
### For Claude Code Users
|
|
46
|
-
|
|
47
|
-
1. **Choose Configuration File**
|
|
48
|
-
- Use `mcp-config.json` for simple setup
|
|
49
|
-
- Use `payware-mcp-config.json` for production
|
|
50
|
-
- Use `claude-code-config.json` for full documentation
|
|
51
|
-
|
|
52
|
-
2. **Configure Claude Code**
|
|
53
|
-
- Copy the chosen configuration to your Claude Code MCP settings
|
|
54
|
-
- Update the `cwd` path to match your payware MCP server location
|
|
55
|
-
- Ensure Node.js is available in your PATH
|
|
56
|
-
|
|
57
|
-
3. **Start payware MCP Server**
|
|
58
|
-
```bash
|
|
59
|
-
cd /path/to/payware/mcp
|
|
60
|
-
npm install
|
|
61
|
-
node src/index.js
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
4. **Test Connection**
|
|
65
|
-
- Open Claude Code
|
|
66
|
-
- Try using `payware_generate_code_example` tool
|
|
67
|
-
- Verify the server responds correctly
|
|
68
|
-
|
|
69
|
-
### Environment Setup
|
|
70
|
-
|
|
71
|
-
Create a `.env` file in the payware MCP directory:
|
|
72
|
-
|
|
73
|
-
```env
|
|
74
|
-
# API Configuration
|
|
75
|
-
PAYWARE_SANDBOX_URL=https://sandbox.payware.eu/api
|
|
76
|
-
PAYWARE_PRODUCTION_URL=https://api.payware.eu/api
|
|
77
|
-
|
|
78
|
-
# Partner Configuration (set these for testing)
|
|
79
|
-
PAYWARE_PARTNER_ID=your_partner_id
|
|
80
|
-
PAYWARE_PRIVATE_KEY_FILE=keys/private-key.pem
|
|
81
|
-
|
|
82
|
-
# Server Configuration
|
|
83
|
-
NODE_ENV=development
|
|
84
|
-
PORT=3000
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Available Tools
|
|
88
|
-
|
|
89
|
-
### 1. `payware_generate_code_example`
|
|
90
|
-
Generate production-ready code examples for payware API integration.
|
|
91
|
-
|
|
92
|
-
**Parameters:**
|
|
93
|
-
- `operation`: API operation (create_transaction, get_product, etc.)
|
|
94
|
-
- `language`: Programming language (python, nodejs, php, java, csharp, curl)
|
|
95
|
-
- `partner_type`: Partner type (merchant, isv, payment_institution)
|
|
96
|
-
- `include_comments`: Include detailed comments (default: true)
|
|
97
|
-
- `include_error_handling`: Include error handling (default: true)
|
|
98
|
-
|
|
99
|
-
**Example:**
|
|
100
|
-
```javascript
|
|
101
|
-
payware_generate_code_example({
|
|
102
|
-
operation: "create_transaction",
|
|
103
|
-
language: "python",
|
|
104
|
-
partner_type: "merchant"
|
|
105
|
-
})
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### 2. `payware_generate_documentation`
|
|
109
|
-
Generate comprehensive integration documentation.
|
|
110
|
-
|
|
111
|
-
**Parameters:**
|
|
112
|
-
- `language`: Programming language focus
|
|
113
|
-
- `partner_type`: Partner type for documentation scope
|
|
114
|
-
|
|
115
|
-
**Example:**
|
|
116
|
-
```javascript
|
|
117
|
-
payware_generate_documentation({
|
|
118
|
-
language: "nodejs",
|
|
119
|
-
partner_type: "merchant"
|
|
120
|
-
})
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Supported Features
|
|
124
|
-
|
|
125
|
-
- **18+ Operations**: Complete API coverage
|
|
126
|
-
- **6 Languages**: python, nodejs, php, java, csharp, curl
|
|
127
|
-
- **3 Partner Types**: merchant, isv, payment_institution
|
|
128
|
-
- **JWT Authentication**: RS256 with content MD5
|
|
129
|
-
- **Error Handling**: Comprehensive try/catch patterns
|
|
130
|
-
- **Production Ready**: Immediately usable code
|
|
131
|
-
|
|
132
|
-
## Troubleshooting
|
|
133
|
-
|
|
134
|
-
### Common Issues
|
|
135
|
-
|
|
136
|
-
1. **"Command not found: node"**
|
|
137
|
-
- Ensure Node.js is installed and in PATH
|
|
138
|
-
- Update `command` in config to full path: `/usr/bin/node`
|
|
139
|
-
|
|
140
|
-
2. **"Cannot find module"**
|
|
141
|
-
- Run `npm install` in the payware MCP directory
|
|
142
|
-
- Check that `cwd` path is correct in configuration
|
|
143
|
-
|
|
144
|
-
3. **"Server not responding"**
|
|
145
|
-
- Verify the server starts without errors
|
|
146
|
-
- Check that port 3000 (or configured port) is available
|
|
147
|
-
- Review server logs for error messages
|
|
148
|
-
|
|
149
|
-
### Verification Steps
|
|
150
|
-
|
|
151
|
-
1. **Manual Server Test**
|
|
152
|
-
```bash
|
|
153
|
-
cd /path/to/payware/mcp
|
|
154
|
-
node src/index.js
|
|
155
|
-
# Should start without errors
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
2. **MCP Protocol Test**
|
|
159
|
-
```bash
|
|
160
|
-
# Test MCP communication (if tools available)
|
|
161
|
-
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}' | node src/index.js
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
3. **Claude Code Integration Test**
|
|
165
|
-
- Add server to Claude Code settings
|
|
166
|
-
- Open new conversation
|
|
167
|
-
- Try: `payware_generate_code_example({operation: "authentication", language: "python"})`
|
|
168
|
-
|
|
169
|
-
## Support
|
|
170
|
-
|
|
171
|
-
For issues with MCP server configuration or integration:
|
|
172
|
-
|
|
173
|
-
1. Check server logs for error messages
|
|
174
|
-
2. Verify Node.js and npm versions
|
|
175
|
-
3. Ensure all dependencies are installed
|
|
176
|
-
4. Test with simple configuration first
|
|
177
|
-
5. Review Claude Code MCP documentation
|
|
178
|
-
|
|
179
|
-
## Security Notes
|
|
180
|
-
|
|
181
|
-
- Store private keys securely outside the repository
|
|
182
|
-
- Use environment variables for sensitive configuration
|
|
183
|
-
- Test with sandbox environment before production
|
|
184
|
-
- Regularly rotate API credentials and private keys
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
**Version**: 1.0.0
|
|
189
|
-
**Last Updated**: 2024-01-20
|
|
190
|
-
**Compatible with**: Claude Code, MCP Protocol v1.0
|