Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions packages/argentina/payway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# @codespar/mcp-payway

> MCP server for **Payway** (ex-Prisma Medios de Pago / Decidir) — Argentina's dominant card-acquiring gateway: card tokenization, one-step and two-step charges, installments (cuotas), marketplace split and refunds.

[![npm](https://img.shields.io/npm/v/@codespar/mcp-payway)](https://www.npmjs.com/package/@codespar/mcp-payway)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Quick Start

### Claude Desktop

Add to `~/.config/claude/claude_desktop_config.json`:

```json
{
"mcpServers": {
"payway": {
"command": "npx",
"args": ["-y", "@codespar/mcp-payway"],
"env": {
"PAYWAY_PUBLIC_API_KEY": "your-public-apikey",
"PAYWAY_PRIVATE_API_KEY": "your-private-apikey",
"PAYWAY_ENV": "sandbox"
}
}
}
}
```

### Claude Code

```bash
claude mcp add payway -- npx @codespar/mcp-payway
```

### Cursor / VS Code

Add to `.cursor/mcp.json` or `.vscode/mcp.json`:

```json
{
"servers": {
"payway": {
"command": "npx",
"args": ["-y", "@codespar/mcp-payway"],
"env": {
"PAYWAY_PUBLIC_API_KEY": "your-public-apikey",
"PAYWAY_PRIVATE_API_KEY": "your-private-apikey",
"PAYWAY_ENV": "sandbox"
}
}
}
}
```

## Authentication

Payway authenticates with a single raw header named `apikey` (**not** `Authorization: Bearer`). Two co-equal keys exist with different powers — see the table below.

## The two-key model

Payway issues two co-equal API keys with different powers:

| Key | Header | May call |
|---|---|---|
| **Public** | `apikey` | `POST /tokens` (card tokenization only) |
| **Private** | `apikey` | Everything else: payments, captures, refunds, queries |

The auth header is a single raw header named `apikey` — **not** `Authorization: Bearer`.

## Tools (6)

| Tool | Endpoint | What it does |
|---|---|---|
| `create_token` | `POST /tokens` | Tokenize card data into a single-use payment token (public key) |
| `create_payment` | `POST /payments` | Charge a token — single sale or distributed/split, with installments |
| `get_payment` | `GET /payments/{id}` | Fetch a payment by id |
| `list_payments` | `GET /payments` | List payments (offset, pageSize, siteOperationId, merchantId) |
| `refund_payment` | `POST /payments/{id}/refunds` | Full refund (empty body) or partial (`amount` in minor units) |
| `confirm_payment` | `PUT /payments/{id}` | Capture a previously authorized payment (two-step flow) |

## Environment

| Variable | Required | Description |
|---|---|---|
| `PAYWAY_PUBLIC_API_KEY` | yes | Public apikey (tokenization) |
| `PAYWAY_PRIVATE_API_KEY` | yes | Private apikey (payments, refunds, queries) |
| `PAYWAY_ENV` | no | `sandbox` (default, Decidir sandbox host) or `production` |

Base URLs: production `https://ventasonline.payway.com.ar/api/v2`, sandbox `https://developers.decidir.com/api/v2`.

## Notes

- Amounts are integers in **minor units**: `50000` = ARS 500.00.
- `payment_method_id` identifies the card brand (1 = Visa, 31 = Mastercard, 15 = Maestro, …).
- `site_transaction_id` is the merchant-side idempotency anchor — unique per sale.
- This server never invents card data; agents must collect PAN/expiry/CVV from the user or a vault.

## Enterprise

Need governance, budget limits, and audit trails for agent-driven payments on Payway? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds a policy engine, payment routing, and compliance templates on top of these MCP servers.

## License

MIT © CodeSpar
35 changes: 35 additions & 0 deletions packages/argentina/payway/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@codespar/mcp-payway",
"version": "0.1.0",
"description": "MCP server for Payway (ex-Prisma/Decidir) — Argentina's dominant card-acquiring gateway: tokenize, charge, capture, refund",
"type": "module",
"main": "./dist/index.js",
"bin": {
"mcp-payway": "./dist/index.js"
},
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.8.0"
},
"license": "MIT",
"keywords": [
"mcp",
"payway",
"decidir",
"prisma-medios-de-pago",
"payments",
"card-acquiring",
"argentina"
],
"mcpName": "io.github.codespar/mcp-payway"
}
53 changes: 53 additions & 0 deletions packages/argentina/payway/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.codespar/mcp-payway",
"description": "Payway (ex-Decidir) — Argentina card acquiring: tokenize, charge, capture, refund",
"repository": {
"url": "https://github.com/codespar/mcp-dev-latam",
"source": "github",
"subfolder": "packages/argentina/payway"
},
"version": "0.1.0",
"packages": [
{
"registryType": "npm",
"identifier": "@codespar/mcp-payway",
"version": "0.1.0",
"transport": {
"type": "stdio"
},
"environmentVariables": [
{
"name": "PAYWAY_PUBLIC_API_KEY",
"description": "Payway PUBLIC apikey — used only by create_token (card tokenization)",
"isRequired": true,
"format": "string",
"isSecret": true
},
{
"name": "PAYWAY_PRIVATE_API_KEY",
"description": "Payway PRIVATE apikey — payments, captures, refunds and queries",
"isRequired": true,
"format": "string",
"isSecret": true
},
{
"name": "PAYWAY_ENV",
"description": "Environment: 'sandbox' or 'production'. Defaults to 'sandbox' (Decidir sandbox host).",
"isRequired": false,
"format": "string",
"isSecret": false
}
]
}
],
"provider": {
"homepage": "https://www.payway.com.ar",
"logoUrl": "https://logo.clearbit.com/payway.com.ar",
"logoFallback": "https://www.google.com/s2/favicons?domain=payway.com.ar&sz=128",
"docsUrl": "https://decidirv2.api-docs.io",
"sandbox": {
"available": true
}
}
}
Loading
Loading