Skip to main content
ClaudeWave
Skill532 estrellas del repoactualizado 2d ago

payments

This Claude Code skill guides payment integration decisions for Butterbase applications. Use it when a user needs to implement subscriptions, one-time charges, marketplace payments, or customer billing portals. It establishes Stripe Connect via `manage_billing` as the default choice for most regions and provides decision logic for selecting regional alternatives like Paystack, Razorpay, or Flutterwave when Stripe cannot service specific geographies or payment methods.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/butterbase-ai/butterbase-skills /tmp/payments && cp -r /tmp/payments/skills/payments ~/.claude/skills/payments
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Butterbase Payments (Stripe)

Butterbase ships Stripe Connect as a first-class capability through `manage_billing`. **Default to Stripe** for payments. Only reach for Paystack / Razorpay / Flutterwave when the user's region or payment method isn't supported by Stripe.

## Decision rule

```
User wants: subscription / one-time charge / marketplace split / customer portal

Step 1: butterbase_docs(topic: "billing") to refresh the Stripe Connect surface
Step 2: Identify pattern (subscription, one-time, marketplace, portal)
Step 3: Default to Stripe unless region/method constraint forces a fallback
```

## Patterns

### Subscriptions
- Stripe Customer + Subscription via Stripe Connect.
- Webhooks routed through a Butterbase HTTP function. Update the user's plan column on `customer.subscription.updated`.

### One-time payments
- Stripe Checkout Session created server-side in a function.
- Redirect URL stored on the order row; webhook completes the order.

### Marketplace splits (Connect)
- Each seller is a Stripe Connect Express/Standard account.
- Payments use `application_fee_amount` for the platform's cut.

### Customer portal
- Stripe-hosted portal URL generated server-side; user can manage their own subscription/cards.

## When Stripe is NOT the right call

Use a regional gateway when:
- **Nigeria, Ghana, Kenya**: Paystack or Flutterwave (Stripe has limited West-Africa support).
- **India**: Razorpay or PayU (Stripe India has constraints on use cases).
- **Pakistan, Bangladesh**: regional gateways only (Stripe unavailable).
- **Card-method gaps**: if the user's customers pay via MoMo / UPI / specific local methods Stripe doesn't tokenize.

### Fallback pattern (regional gateway)

If Stripe is genuinely unavailable, deploy an HTTP function that proxies the regional gateway. Don't put gateway secrets in the frontend. Document this in the app's plan and notes.

## Documentation

For the `manage_billing` action surface and Stripe Connect specifics, WebFetch `https://docs.butterbase.ai/payments` or call `butterbase_docs` with `topic: "billing"`.

## Anti-patterns

- ❌ Recommending Paystack to a US/EU/UK user "because it's simpler." Stripe is simpler in those regions.
- ❌ Embedding payment secrets in the frontend.
- ❌ Skipping webhooks. Subscription state must come from webhooks, not from optimistic UI.
- ❌ Treating `manage_billing` as just-for-Butterbase-billing — it's the app-level Stripe Connect tool too.