skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
tinyshipcn/tinyship-skills92 installs

tinyship-payment

Set up payment providers for TinyShip: Stripe, PayPal, WeChat Pay, Alipay, Creem, Dodo Payments, and Waffo Pancake. Covers sandbox/test mode, webhook setup, pricing plans (static config or dynamic admin-managed), and credit system. Use when the user asks to "set up stripe", "configure payment", "add wechat pay", "configure alipay", "set up paypal", "set up waffo", "payment integration", "configure pricing plans", "add billing", "set up credits", "dynamic pricing", "manage plans in admin", or "change price without redeploying".

How do I install this agent skill?

npx skills add https://github.com/tinyshipcn/tinyship-skills --skill tinyship-payment
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides comprehensive documentation for integrating multiple payment providers (Stripe, PayPal, WeChat Pay, Alipay) into the TinyShip platform. It follows security best practice by advising the use of environment variables for secret management. A low-risk attack surface for indirect prompt injection is identified in the dynamic pricing feature where pricing plan metadata managed by an admin is ingested into the agent context.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

TinyShip Payment Integration

Guide for setting up payment providers in TinyShip.

Provider Selection

Ask the user about their target market to recommend providers:

MarketRecommendedSubscription Support
ChinaWeChat Pay, AlipayOne-time + credits only
GlobalStripeFull (one-time, recurring, credits)
Global (easy onboard)CreemFull (one-time, recurring, credits)
Global (alt)PayPalFull (one-time, recurring, credits)
Global (MoR/tax-free)Dodo PaymentsFull (Merchant of Record)
Global (MoR/tax-free)Waffo PancakeFull (Merchant of Record; no CNY for subscriptions)

Setup by Provider

Read the relevant reference file for detailed steps:

For Creem, Dodo Payments, and Waffo Pancake, read docs/user-guide/payment/creem.md, docs/user-guide/payment/dodo.md, and docs/user-guide/payment/waffo.md from the TinyShip repo.

Waffo specifics to keep in mind: API keys are bound to Test or Production at creation time (no TEST_MODE switch), webhook verification uses an RSA public key (the SDK has Test/Prod keys built in), and each plan needs a waffoProductId (PROD_xxx).

Configure Pricing Plans

After setting up a provider, you can configure plans in two ways:

Option A: Static Plans (default)

Define plans directly in config/payment.ts:

plans: {
  monthly: {
    provider: 'stripe',           // must match your configured provider
    id: 'monthly',
    amount: 10,
    currency: 'USD',
    duration: { months: 1, type: 'recurring' },
    stripePriceId: 'price_xxx',   // provider-specific ID (required for Stripe)
    i18n: {
      'en': {
        name: 'Monthly Plan',
        description: 'Full access for one month',
        duration: 'month',
        features: ['All features', 'Priority support']
      },
      'zh-CN': {
        name: '月度订阅',
        description: '一个月完整访问',
        duration: '月',
        features: ['所有功能', '优先支持']
      }
    }
  }
}

Plans automatically appear on the /pricing page.

Option B: Dynamic Pricing (admin-managed)

Set PRICING_MODE="dynamic" in .env to enable. Plans are then stored in the database and managed via the admin panel at /admin/pricing — prices can be adjusted anytime without code changes or redeployment.

Fresh projects already include the pricing_plan table in the schema, so a normal database init covers it. Projects upgraded from older versions must add the table first:

pnpm db:push          # PostgreSQL
pnpm db:push:sqlite   # SQLite / D1

Dynamic pricing adds:

  • Creating/editing/reordering plans from the admin UI
  • Markdown-formatted feature lists
  • Strikethrough pricing (original price)
  • Locale-based plan visibility
  • One-click import of existing static plans into the database

To migrate existing static plans: enable dynamic mode, open /admin/pricing, click "Import from Config", verify each plan's provider IDs, then run a test payment. Switch back anytime by setting PRICING_MODE="static" and restarting — dynamic plan data is preserved.

See docs/user-guide/payment/dynamic-pricing.md in the TinyShip repo for full details.

Plan Types

Typeduration.typeProviders
One-timeone_timeAll
SubscriptionrecurringStripe, Creem, PayPal, Dodo, Waffo
Credit packcreditsAll (set duration.credits: 100)

Webhook Setup (Local Development)

Payment providers need to send webhooks to your app. For local development:

  1. Install a tunnel tool:
# Option A: ngrok
ngrok http 7001

# Option B: Cloudflare Tunnel
cloudflared tunnel --url http://localhost:7001
  1. Use the tunnel URL as your webhook endpoint
  2. Configure the webhook URL in the provider's dashboard

Webhook endpoints are at: {BASE_URL}/api/payment/webhook/{provider} (e.g., /api/payment/webhook/stripe)

Credit System (Optional)

To enable AI credit consumption, configure config/credits.ts:

credits: {
  consumptionMode: 'dynamic',          // 'fixed' or 'dynamic'
  fixedChatCost: 10,                   // credits per chat (fixed mode)
  dynamicChatCostPerKiloToken: 1,      // credits per 1K tokens (dynamic mode)
  modelMultipliers: {
    'qwen3.7-flash': 1.0,
    'gpt-5.6-sol': 2.0,
    'default': 1.0
  }
}

Add a credit purchase plan alongside subscription plans:

credits100: {
  provider: 'stripe',
  id: 'credits100',
  amount: 10,
  currency: 'USD',
  duration: { type: 'credits', credits: 100 },
  stripePriceId: 'price_xxx',
  i18n: { /* ... */ }
}

Verify

  1. Start the dev server
  2. Visit /pricing — plans should display
  3. Click a plan and complete a test payment (use sandbox/test mode)
  4. Check /dashboard — order should appear
  5. For subscriptions, verify /api/subscription/status returns active status

Reference Files in TinyShip Repo

  • config/payment.ts — payment provider and plan configuration
  • config/credits.ts — credit system configuration
  • libs/payment/AGENTS.md — payment library architecture
  • libs/credits/AGENTS.md — credit system architecture
  • docs/user-guide/payment/overview.md — payment documentation index
  • docs/user-guide/payment/waffo.md — Waffo Pancake setup (MoR, hosted checkout)
  • docs/user-guide/payment/dynamic-pricing.md — dynamic pricing admin guide
  • docs/user-guide/payment-testing.md — testing and webhook debug guide

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/tinyshipcn/tinyship-skills/tinyship-payment">View tinyship-payment on skillZs</a>