TinyShip
TinyShip
 TinyShip
TinyShip
TinyShip Documentation
TinyShip User GuideGetting StartedBasic Configuration
Payment ConfigurationStripe ConfigurationPayPal ConfigurationWeChat Pay ConfigurationAlipay ConfigurationCreem ConfigurationDodo Payments ConfigurationPayment Testing
Credits System Configuration
Storage Service ConfigurationDatabase ConfigurationCaptcha Configuration
Development Best PracticesLocal E2E Workflow
User GuidePayment

Payment Configuration

TinyShip payment system configuration guide

TinyShip supports six payment methods: WeChat Pay, Alipay, Stripe, PayPal, Creem, and Dodo Payments, with three payment modes: one-time payment, subscription, and credits (WeChat Pay and Alipay only support one-time and credits).

Credits System: For AI credit consumption configuration, see Credits System Configuration.

AI Quick Setup: Users with Agent Skills installed can tell their AI "help me configure payment" to use the tinyship-payment skill for interactive setup.

Related Pages

PagePathDescription
Pricing/pricingDisplay all payment plans
Payment Success/payment-successPayment success redirect
Payment Cancel/payment-cancelPayment cancel redirect
Dashboard/dashboardView subscription status and order history

Supported Payment Methods

MethodOne-timeSubscriptionCreditsPrimary MarketCurrency
WeChat PayYesNoYesChinaCNY
AlipayYesNoYesChinaCNY
StripeYesYesYesGlobalMulti-currency
PayPalYesYesYesGlobalMulti-currency
CreemYesYesYesGlobalUSD, EUR, etc.
Dodo PaymentsYesYesYesGlobalMulti-currency

Configuration Overview

Configure through providers in config/payment.ts. Choose based on your project needs:

  • Chinese users: Recommend WeChat Pay or Alipay
  • International users: Recommend Stripe or PayPal
  • Easier approval: Recommend Creem
  • Tax and compliance offloading: Recommend Dodo Payments in Merchant of Record mode

Important: During local development, prefer test/sandbox mode (Stripe and Creem support this, WeChat Pay does not). For WeChat Pay testing, use real 0.01 CNY payments.

Detailed Configuration Documents

Choose the payment methods you need:

WeChat Pay Configuration

Recommended for Chinese market, supports QR code payment

Alipay Configuration

Recommended for the Chinese market

Stripe Configuration

International market, supports subscriptions and one-time payments

PayPal Configuration

Global market, supports subscriptions and one-time payments

Creem Configuration

Recommended for indie developers going global, easy approval

Dodo Payments Configuration

Merchant of Record payments for global SaaS and digital products

Payment Testing Guide

Local development testing and Webhook debugging

Configure Payment Plans

Configure pricing plans through plans in config/payment.ts. Plans configured here will automatically appear on the /pricing page.

Plan Types

TypeDescriptionUse Case
One-timePay once for permanent accessLifetime membership, software license
SubscriptionRecurring billing by periodSaaS services, monthly membership
CreditsBuy credits, consume by usageAI chat, image generation

Plan Configuration Structure

Each plan requires the following fields:

config/payment.ts
plans: {
  lifetime: {
    provider: 'wechat',           // Payment provider: 'wechat' | 'alipay' | 'stripe' | 'paypal' | 'creem' | 'dodo'
    id: 'lifetime',               // Unique plan identifier
    amount: 199.00,               // Price amount
    originalAmount: 299.00,       // Original price (for showing discount)
    currency: 'CNY',              // Currency: 'CNY' | 'USD' | 'EUR' etc.
    recommended: true,            // Whether to highlight on pricing page
    hidden: false,                // Whether to hide from pricing page
    duration: {
      months: 999999,             // Duration in months (999999 = lifetime)
      type: 'one_time'            // Type: 'one_time' | 'recurring' | 'credits'
    },
    // Creem-specific field
    creemProductId: 'prod_xxx',   // Creem product ID (required for Creem)
    // Dodo Payments-specific field
    dodoProductId: 'pdt_xxx',     // Dodo product ID (required for Dodo Payments)
    // Stripe-specific field
    stripePriceId: 'price_xxx',   // Stripe price ID (required for Stripe subscriptions)
    i18n: { /* i18n config */ }
  }
}

Field Reference

FieldTypeRequiredDescription
providerstringYesPayment provider to use
idstringYesUnique plan identifier for API calls
amountnumberYesPrice amount
originalAmountnumberNoOriginal price for showing discounts
currencystringYesCurrency code (ISO 4217)
recommendedbooleanNoHighlight on pricing page
hiddenbooleanNoHide from pricing page
duration.monthsnumberYesDuration in months
duration.typestringYesPayment type
creemProductIdstringCreem requiredCreem platform product ID
dodoProductIdstringDodo Payments requiredDodo Payments platform product ID
stripePriceIdstringStripe sub requiredStripe platform price ID

Internationalization

Each plan needs multi-language support:

config/payment.ts
i18n: {
  'en': {
    name: 'Monthly Plan',
    description: 'Perfect for short-term projects', 
    duration: 'month',
    features: ['All premium features', 'Priority support']
  },
  'zh-CN': {
    name: '月度订阅',
    description: '每月订阅,灵活管理',
    duration: '月', 
    features: ['所有高级功能', '优先支持']
  }
}

Complete Example

Here's a complete lifetime plan configuration example:

config/payment.ts
lifetime: {
  provider: 'wechat',
  id: 'lifetime',
  amount: process.env.NODE_ENV === 'development' ? 0.01 : 199.00,
  originalAmount: 299.00,
  currency: 'CNY',
  recommended: true,
  duration: {
    months: 999999,
    type: 'one_time'
  },
  i18n: {
    'en': {
      name: 'TinyShip Complete',
      description: 'Get lifetime access to the complete SaaS starter kit',
      duration: 'lifetime',
      features: [
        'Complete SaaS template source code',
        'Free lifetime updates',
        'Priority customer support',
        'Access to private GitHub repository'
      ]
    },
    'zh-CN': {
      name: 'TinyShip 完整版',
      description: '获得完整SaaS启动套件的终身访问权限',
      duration: '终身',
      features: [
        '完整SaaS模板源码',
        '终身免费更新',
        '优先客户支持',
        '访问GitHub私有仓库'
      ]
    }
  }
}

Development Testing: The example uses process.env.NODE_ENV === 'development' ? 0.01 : 199.00 to differentiate between development and production prices for easy testing.

Payment Flow

  1. User selects plan → 2. Create order → 3. Redirect to payment → 4. Handle callback → 5. Update status

API Endpoints

// Initiate payment
POST /api/payment/initiate
{
  "planId": "monthly",
  "provider": "stripe"
}

// Query payment status
GET /api/payment/query/:orderId

// Webhook handler
POST /api/payment/webhook/:provider

// Cancel payment
POST /api/payment/cancel/:orderId

Reference Documentation

  • Payment Testing Guide - Local development and Webhook debugging
  • Credits System Guide - Credit recharge and consumption

Official Documentation

  • WeChat Pay Documentation
  • Alipay Open Platform
  • Stripe Documentation
  • PayPal Developer Documentation
  • Creem API Documentation
  • Dodo Payments Documentation

SMS Verification Login

Configure phone SMS verification login

Stripe Configuration

Configure Stripe payment

On this page

Related PagesSupported Payment MethodsConfiguration OverviewDetailed Configuration DocumentsConfigure Payment PlansPlan TypesPlan Configuration StructureField ReferenceInternationalizationComplete ExamplePayment FlowAPI EndpointsReference DocumentationOfficial Documentation