Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.1 KB
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { stripeAuth } from '../..';
import { stripeCommon, getClient } from '../common';

import { paymentLinkOutputSchema } from '../output-schemas';
export const stripeDeactivatePaymentLink = createAction({
  name: 'deactivate_payment_link',
  classification: 'DESTRUCTIVE',
  auth: stripeAuth,
  displayName: 'Deactivate Payment Link',
  description: 'Turn off a payment link so no one can pay with it.',
  audience: 'human',
  aiMetadata: {
    description:
      'Deactivates an existing Stripe payment link by its ID so it can no longer accept payments. Use to retire a shared checkout URL. Idempotent in effect: re-running on an already-inactive link leaves it inactive.',
    idempotent: true,
  },
  props: {
    payment_link_id: stripeCommon.paymentLink,
  },
  outputSchema: paymentLinkOutputSchema,
  async run(context) {
    const { payment_link_id } = context.propsValue;
    const client = getClient(context.auth.secret_text);
    return await client.paymentLinks.update(payment_link_id, {
      active: false,
    });
  },
});