💳

@radzor/stripe-checkout

Simplified Stripe Checkout integration. Creates checkout sessions, handles payment webhooks, and manages subscription lifecycle.

Paymentv0.1.0typescriptpythonstripepaymentcheckoutsubscriptionbilling2,372 downloadsby Radzor
$npx radzor add stripe-checkout
⚠ Constraints: Requires Stripe secret key (server-side) and publishable key (client-side). Webhook endpoint must be publicly accessible. Use STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET environment variables.

Inputs

NameTypeDefaultDescription
priceId*stringStripe Price ID for the product or subscription.
quantitynumber1Quantity of the item to purchase.
successUrl*stringURL to redirect to after successful payment.
cancelUrl*stringURL to redirect to if the user cancels checkout.
mode'payment' | 'subscription'paymentCheckout mode: one-time payment or recurring subscription.

Outputs

NameTypeDescription
checkoutSessionStripeCheckoutSessionThe created Stripe Checkout session with URL and ID.
paymentStatus'pending' | 'succeeded' | 'failed' | 'canceled'Current payment status.

Actions

createCheckout(customerEmail: string)Promise<StripeCheckoutSession>

Create a new Stripe Checkout session and return the session URL.

getPaymentStatus(sessionId: string)Promise<string>

Check the payment status of a checkout session.

cancelSubscription(subscriptionId: string)Promise<void>

Cancel an active subscription at the end of the current billing period.

handleWebhook(payload: string, signature: string)Promise<WebhookEvent>

Verify and parse a Stripe webhook event.

Events

onPaymentSuccess{amount: number, sessionId: string, customerId: string}

Fired when payment is successfully completed (via webhook).

onPaymentFailed{error: string, sessionId: string}

Fired when payment fails.

onSubscriptionCreated{priceId: string, customerId: string, subscriptionId: string}

Fired when a new subscription is created.

onSubscriptionCanceled{subscriptionId: string}

Fired when a subscription is canceled.

Composability

paymentStatus
@radzor/access-control.input.paymentStatus

radzor.manifest.json

{
  "llm": {
    "constraints": "Requires Stripe secret key (server-side) and publishable key (client-side). Webhook endpoint must be publicly accessible. Use STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET environment variables.",
    "usageExamples": "llm/examples.md",
    "integrationPrompt": "llm/integration.md"
  },
  "name": "@radzor/stripe-checkout",
  "tags": [
    "stripe",
    "payment",
    "checkout",
    "subscription",
    "billing"
  ],
  "events": [
    {
      "name": "onPaymentSuccess",
      "payload": {
        "amount": "number",
        "sessionId": "string",
        "customerId": "string"
      },
      "description": "Fired when payment is successfully completed (via webhook)."
    },
    {
      "name": "onPaymentFailed",
      "payload": {
        "error": "string",
        "sessionId": "string"
      },
      "description": "Fired when payment fails."
    },
    {
      "name": "onSubscriptionCreated",
      "payload": {
        "priceId": "string",
        "customerId": "string",
        "subscriptionId": "string"
      },
      "description": "Fired when a new subscription is created."
    },
    {
      "name": "onSubscriptionCanceled",
      "payload": {
        "subscriptionId": "string"
      },
      "description": "Fired when a subscription is canceled."
    }
  ],
  "inputs": [
    {
      "name": "priceId",
      "type": "string",
      "required": true,
      "description": "Stripe Price ID for the product or subscription."
    },
    {
      "name": "quantity",
      "type": "number",
      "default": 1,
      "required": false,
      "description": "Quantity of the item to purchase."
    },
    {
      "name": "successUrl",
      "type": "string",
      "required": true,
      "description": "URL to redirect to after successful payment."
    },
    {
      "name": "cancelUrl",
      "type": "string",
      "required": true,
      "description": "URL to redirect to if the user cancels checkout."
    },
    {
      "name": "mode",
      "type": "'payment' | 'subscription'",
      "default": "payment",
      "required": false,
      "description": "Checkout mode: one-time payment or recurring subscription."
    }
  ],
  "radzor": "1.0.0",
  "actions": [
    {
      "name": "createCheckout",
      "params": [
        {
          "name": "customerEmail",
          "type": "string",
          "required": false,
          "description": "Customer email for the checkout session."
        }
      ],
      "returns": "Promise<StripeCheckoutSession>",
      "description": "Create a new Stripe Checkout session and return the session URL."
    },
    {
      "name": "getPaymentStatus",
      "params": [
        {
          "name": "sessionId",
          "type": "string",
          "description": "Stripe Checkout session ID."
        }
      ],
      "returns": "Promise<string>",
      "description": "Check the payment status of a checkout session."
    },
    {
      "name": "cancelSubscription",
      "params": [
        {
          "name": "subscriptionId",
          "type": "string",
          "description": "Stripe subscription ID to cancel."
        }
      ],
      "returns": "Promise<void>",
      "description": "Cancel an active subscription at the end of the current billing period."
    },
    {
      "name": "handleWebhook",
      "params": [
        {
          "name": "payload",
          "type": "string",
          "description": "Raw request body from Stripe webhook."
        },
        {
          "name": "signature",
          "type": "string",
          "description": "Stripe-Signature header value."
        }
      ],
      "returns": "Promise<WebhookEvent>",
      "description": "Verify and parse a Stripe webhook event."
    }
  ],
  "outputs": [
    {
      "name": "checkoutSession",
      "type": "StripeCheckoutSession",
      "description": "The created Stripe Checkout session with URL and ID."
    },
    {
      "name": "paymentStatus",
      "type": "'pending' | 'succeeded' | 'failed' | 'canceled'",
      "description": "Current payment status."
    }
  ],
  "version": "0.1.0",
  "category": "payment",
  "languages": [
    "typescript",
    "python"
  ],
  "description": "Simplified Stripe Checkout integration. Creates checkout sessions, handles payment webhooks, and manages subscription lifecycle.",
  "dependencies": {
    "radzor": [
      "@radzor/auth-oauth"
    ],
    "packages": {
      "stripe": "^14.0.0"
    }
  },
  "composability": {
    "connectsTo": [
      {
        "output": "paymentStatus",
        "compatibleWith": [
          "@radzor/access-control.input.paymentStatus"
        ]
      }
    ]
  }
}

Version History

0.1.0

Initial release

4/3/2026