AgentSkillsCN

stripe-saas-integration

处理 SaaS 订阅的 Stripe 集成。在实现计费、订阅或支付流程时,可使用此技能。

SKILL.md
--- frontmatter
name: stripe-saas-integration
description: Handles Stripe integration for SaaS subscriptions. Use when implementing billing, subscriptions, or payment flows.

Stripe Integration Skill

Goal: Implement secure Stripe integration with webhook handling

Instructions:

  1. Environment Variables: Verify STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET exist
  2. Webhook Security: Always validate webhook signature with stripe.webhooks.constructEvent
  3. Idempotency: Use idempotency keys for payment intents
  4. Database Sync: Update subscription status only after webhook confirmation
  5. Error Handling: Graceful handling of failed payments with retry logic

Constraints:

  • Never log full Stripe objects (contain sensitive data)
  • Always use Stripe SDK methods, never construct raw API calls
  • Test webhooks locally using Stripe CLI before deployment