list_payment_links
Retrieve paginated payment links from Visa Acceptance. Optionally filter by status to organize and review payment links for management.
Instructions
This tool will list payment links from Visa Acceptance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | Yes | Pagination offset (required) | |
| limit | Yes | Pagination limit (required) | |
| status | No | Filter by status (optional) |
Implementation Reference
- The main handler function that executes the 'list_payment_links' tool. It uses the CyberSource PaymentLinksApi.getAllPaymentLinks to fetch payment links with pagination (offset, limit) and an optional status filter.
export const listPaymentLinks = async ( visaClient: any, context: VisaContext, params: z.infer<ReturnType<typeof listPaymentLinksParameters>> ) => { try { const paymentLinkApiInstance = new cybersourceRestApi.PaymentLinksApi(visaClient.configuration, visaClient.visaApiClient); const opts: { status?: string } = {}; if (params.status) { opts.status = params.status; } const result = await new Promise((resolve, reject) => { paymentLinkApiInstance.getAllPaymentLinks( params.offset, params.limit, opts, (error: any, data: any) => { if (error) { reject(error); } else { resolve(data); } } ); }); return result; } catch (error) { return 'Failed to list payment links'; } }; - Input parameter schema for the 'list_payment_links' tool, defined using Zod. Parameters: offset (number, required), limit (number, required), status (string, optional).
export const listPaymentLinksParameters = ( context: VisaContext = {} as VisaContext ) => { return z.object({ offset: z.number().describe('Pagination offset (required)'), limit: z.number().describe('Pagination limit (required)'), status: z.string().optional().describe('Filter by status (optional)') }); }; - typescript/src/shared/paymentLinks/listPaymentLinks.ts:65-76 (registration)Registration of the tool as a Tool object with method 'list_payment_links', name 'List Payment Links', description, parameters, actions (paymentLinks with read permission), and the execute handler.
const tool = (context: VisaContext): Tool => ({ method: 'list_payment_links', name: 'List Payment Links', description: listPaymentLinksPrompt(context), parameters: listPaymentLinksParameters(context), actions: { paymentLinks: { read: true, }, }, execute: listPaymentLinks, }); - typescript/src/shared/tools.ts:40-51 (registration)The createTools function that collects all tools into an array, including listPaymentLinkToolModule(context) which creates the 'list_payment_links' tool.
export function createTools(context: VisaContext): Tool[] { return [ createInvoiceToolModule(context), updateInvoiceToolModule(context), getInvoiceToolModule(context), listInvoicesToolModule(context), sendInvoiceToolModule(context), cancelInvoiceToolModule(context), createPaymentLinkToolModule(context), updatePaymentLinkToolModule(context), getPaymentLinkToolModule(context), listPaymentLinkToolModule(context) - The maskPII utility function imported by listPaymentLinks.ts (though not used directly in the handler, it is imported).
export const maskPII = (