get_payment_channels
Retrieve available payment channels for processing transactions through the Bayarcash MCP Server, with optional filtering by portal key.
Instructions
Get list of available payment channels
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| portal_key | No | Optional portal key to filter channels |
Implementation Reference
- src/index.ts:326-342 (handler)MCP tool handler for get_payment_channels: validates optional portal_key and delegates to bayarcash.getChannels()case 'get_payment_channels': { // Validate input const validation = validateInput(portalKeySchema, args); if (!validation.success) { throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`); } const result = await bayarcash.getChannels(validation.data.portal_key); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/index.ts:189-201 (registration)Registration of get_payment_channels tool in ListToolsRequestHandler, defining name, description, and input schema{ name: 'get_payment_channels', description: 'Get list of available payment channels', inputSchema: { type: 'object', properties: { portal_key: { type: 'string', description: 'Optional portal key to filter channels' } } } },
- src/bayarcash-client.ts:232-246 (helper)Core helper method getChannels() that returns a hardcoded list of available payment channels (portal_key parameter is unused)async getChannels(portalKey?: string): Promise<PaymentChannel[]> { // Return hardcoded payment channels return [ { id: '1', name: 'FPX', code: 'fpx' }, { id: '2', name: 'DuitNow', code: 'duitnow' }, { id: '3', name: 'Boost', code: 'boost' }, { id: '4', name: 'GrabPay', code: 'grabpay' }, { id: '5', name: 'Touch n Go', code: 'tng' }, { id: '6', name: 'ShopeePay', code: 'shopeepay' }, { id: '7', name: 'SPayLater', code: 'spaylater' }, { id: '8', name: 'Boost PayFlex', code: 'boostpayflex' }, { id: '9', name: 'QRIS', code: 'qris' }, { id: '10', name: 'NETS', code: 'nets' } ]; }
- src/validation.ts:90-93 (schema)Zod schema for validating the input to get_payment_channels tool (optional portal_key)// Portal key schema export const portalKeySchema = z.object({ portal_key: z.string().optional() });