create_payment
Create a new payment using an existing mandate by specifying amount, currency, and payment details to process transactions through GoCardless.
Instructions
Create a new payment in GoCardless
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount in minor currency unit (e.g., 1000 for £10.00) | |
| currency | Yes | ISO 4217 currency code (e.g., GBP, EUR) | |
| description | No | Payment description | |
| mandate_id | Yes | ID of the mandate to use for this payment |
Implementation Reference
- src/gocardless_mcp/server.py:369-384 (handler)Implements the core logic for the create_payment tool by constructing parameters and calling the GoCardless client to create a new payment.elif name == "create_payment": params = { "amount": arguments["amount"], "currency": arguments["currency"], "links": {"mandate": arguments["mandate_id"]}, } if "description" in arguments: params["description"] = arguments["description"] payment = client.payments.create(params=params) return [ types.TextContent( type="text", text=f"Payment created successfully:\n{_format_json({'id': payment.id, 'amount': payment.amount, 'currency': payment.currency, 'status': payment.status})}", ) ]
- src/gocardless_mcp/server.py:131-156 (schema)Defines the input schema and description for the create_payment tool in the list_tools handler.types.Tool( name="create_payment", description="Create a new payment in GoCardless", inputSchema={ "type": "object", "properties": { "amount": { "type": "integer", "description": "Amount in minor currency unit (e.g., 1000 for £10.00)", }, "currency": { "type": "string", "description": "ISO 4217 currency code (e.g., GBP, EUR)", }, "mandate_id": { "type": "string", "description": "ID of the mandate to use for this payment", }, "description": { "type": "string", "description": "Payment description", }, }, "required": ["amount", "currency", "mandate_id"], }, ),