collect-card
Enable AI assistants to manage payment cards securely on the Terminal.shop platform, facilitating transactions and subscription handling through its API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:930-955 (handler)The inline handler function for the 'collect-card' tool. It generates a secure URL for collecting card details by calling the terminalApi.post('/card/collect') endpoint and returns a message with the URL. Handles errors by returning an error message.server.tool("collect-card", {}, async () => { try { const response = await terminalApi.post("/card/collect"); const data = response.data.data; return { content: [ { type: "text", text: `Please use this URL to securely enter your card details: ${data.url}\nAfter completing the form, your card will be added to your account.`, }, ], }; } catch (error) { console.error("Error generating card collection URL:", error); return { content: [ { type: "text", text: `Error generating card collection URL: ${error.message}`, }, ], isError: true, }; } });
- server.js:930-955 (registration)Registration of the 'collect-card' tool using server.tool(), with empty schema {} and inline handler.server.tool("collect-card", {}, async () => { try { const response = await terminalApi.post("/card/collect"); const data = response.data.data; return { content: [ { type: "text", text: `Please use this URL to securely enter your card details: ${data.url}\nAfter completing the form, your card will be added to your account.`, }, ], }; } catch (error) { console.error("Error generating card collection URL:", error); return { content: [ { type: "text", text: `Error generating card collection URL: ${error.message}`, }, ], isError: true, }; } });