Skip to main content
Glama

mcp-google-sheets

cancel-subscription.ts1.16 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { stripeAuth } from '../..'; import { stripeCommon, getClient } from '../common'; export const stripeCancelSubscription = createAction({ name: 'cancel_subscription', auth: stripeAuth, displayName: 'Cancel Subscription', description: 'Cancel an existing subscription, either immediately or at the end of the current billing period.', props: { subscription: stripeCommon.subscription, cancel_at_period_end: Property.Checkbox({ displayName: 'Cancel at Period End', description: 'If true, the subscription remains active until the end of the current billing period. If false, it cancels immediately.', required: false, defaultValue: false, }), }, async run(context) { const { subscription, cancel_at_period_end } = context.propsValue; const client = getClient(context.auth); if (cancel_at_period_end) { return await client.subscriptions.update(subscription, { cancel_at_period_end: true, }); } else { return await client.subscriptions.cancel(subscription); } }, });

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/activepieces/activepieces'

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