list_payment_links
Retrieve and filter payment links from Visa Acceptance with pagination support to manage transaction records efficiently.
Instructions
This tool will list payment links from Visa Acceptance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | Pagination limit (required) | |
| offset | Yes | Pagination offset (required) | |
| status | No | Filter by status (optional) |
Implementation Reference
- Handler function that lists payment links using CyberSource REST API.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'; } };
- Zod schema defining the input parameters for the list_payment_links tool.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-78 (registration)Tool definition object for 'list_payment_links' with method name, parameters, and reference to the handler function.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, }); export default tool;
- typescript/src/shared/tools.ts:40-53 (registration)Central registration function that aggregates all tools, including listPaymentLinks by invoking its module.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) ]; }