Skip to main content
Glama

paymentSessions.list

Retrieve and filter Ryft payment sessions by date, account, or other parameters to monitor transaction activity and manage financial records.

Instructions

List Ryft payment sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startTimestampNo
endTimestampNo
ascendingNo
limitNo
startsAfterNo
accountIdNo

Implementation Reference

  • The handler for 'paymentSessions.list' that parses arguments using 'listPaymentSessionsSchema' and performs a GET request to '/payment-sessions'.
    registerTool(
      'paymentSessions.list',
      'List Ryft payment sessions.',
      listPaymentSessionsSchema.shape,
      async (args) => {
        const parsed = listPaymentSessionsSchema.parse(args);
        const { accountId, ...query } = parsed;
        return client.get('/payment-sessions', {
          query: query as Record<string, QueryValue>,
          ...(accountId ? { accountId } : {}),
        });
      },
    );
  • The schema definition for arguments accepted by 'paymentSessions.list'.
    const listPaymentSessionsSchema = z.object({
      startTimestamp: z.number().int().optional(),
      endTimestamp: z.number().int().optional(),
      ascending: z.boolean().optional(),
      limit: z.number().int().positive().max(100).optional(),
      startsAfter: z.string().optional(),
      accountId: z.string().optional(),
    });
  • Registration of 'paymentSessions.list' within the 'registerPaymentSessionTools' function.
    export function registerPaymentSessionTools(registerTool: ToolRegistrar, client: RyftHttpClient) {
      registerTool(
        'paymentSessions.create',
        'Create a Ryft payment session.',
        paymentSessionCreateSchema.shape,
        async (args) => {
          const parsed = paymentSessionCreateSchema.parse(args);
          return client.post('/payment-sessions', {
            amount: parsed.amount,
            currency: parsed.currency,
            customerEmail: parsed.customerEmail,
            paymentType: parsed.paymentType,
            entryMode: normalizeEntryMode(parsed.entryMode),
            captureFlow: parsed.captureFlow,
            metadata: parsed.metadata,
            ...(parsed.customerId ? { customer: { id: parsed.customerId } } : {}),
          });
        },
      );
    
      registerTool(
        'paymentSessions.get',
        'Get a Ryft payment session by id.',
        { id: z.string().min(1) },
        async ({ id }) => client.get(`/payment-sessions/${id}`),
      );
    
      registerTool(
        'paymentSessions.list',
        'List Ryft payment sessions.',
        listPaymentSessionsSchema.shape,
        async (args) => {
          const parsed = listPaymentSessionsSchema.parse(args);
          const { accountId, ...query } = parsed;
          return client.get('/payment-sessions', {
            query: query as Record<string, QueryValue>,
            ...(accountId ? { accountId } : {}),
          });
        },
      );
    
      registerTool(
        'paymentSessions.update',
        'Update a Ryft payment session.',
        paymentSessionUpdateSchema.shape,
        async (args) => {
          const parsed = paymentSessionUpdateSchema.parse(args);
          const { id, customerEmail, ...rest } = parsed;
          const body = {
            ...rest,
            ...(customerEmail ? { customerEmail } : {}),
          };
          return client.patch(`/payment-sessions/${id}`, body);
        },
      );
    
      registerTool(
        'paymentSessions.refund',
        'Refund a Ryft payment session.',
        refundSchema.shape,
        async (args) => {
          const parsed = refundSchema.parse(args);
          const { id, ...body } = parsed;
          return client.post(`/payment-sessions/${id}/refunds`, body);
        },
      );
    
      registerTool(
        'paymentSessions.capture',
        'Capture a manually captured Ryft payment session.',
        { id: z.string().min(1), amount: z.number().int().positive().optional() },
        async ({ id, ...body }) => client.post(`/payment-sessions/${id}/captures`, body),
      );
    
      registerTool(
        'paymentSessions.void',
        'Void a Ryft payment session.',
        { id: z.string().min(1) },
        async ({ id }) => client.post(`/payment-sessions/${id}/voids`, {}),
      );
    
      registerTool(
        'paymentSessions.continuePayment',
        'Continue a Ryft payment after a required action such as 3DS.',
        {
          clientSecret: z.string().min(1),
          threeDs: z.record(z.string(), z.unknown()).optional(),
        },
        async (args) => client.post('/payment-sessions/continue-payment', args),
      );
    
      registerTool(
        'paymentSessions.listTransactions',
        'List transactions for a payment session.',
        {
          id: z.string().min(1),
        },
        async ({ id }) => client.get(`/payment-sessions/${id}/transactions`),
      );
    
      registerTool(
        'paymentSessions.getTransaction',
        'Get a payment session transaction by id.',
        {
          id: z.string().min(1),
          transactionId: z.string().min(1),
        },
        async ({ id, transactionId }) => client.get(`/payment-sessions/${id}/transactions/${transactionId}`),
      );
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bkawk/ryft-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server