TinyShip
TinyShip
 TinyShip
TinyShip
TinyShip Documentation
TinyShip User GuideGetting StartedBasic Configuration
Payment ConfigurationStripe ConfigurationPayPal ConfigurationWeChat Pay ConfigurationAlipay ConfigurationCreem ConfigurationPayment Testing
Credits System Configuration
Storage Service ConfigurationCaptcha Configuration
User GuidePayment

Payment Configuration

TinyShip payment system configuration guide

TinyShip supports five payment methods: WeChat Pay, Alipay, Stripe, PayPal, and Creem, 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.

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.

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

Important: During local development, use test/sandbox mode (Stripe, Creem, PayPal, and Alipay 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

Chinese market, supports sandbox testing

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

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'
    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)
    // 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
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 Documentation
  • Stripe Documentation
  • PayPal Developer Documentation
  • Creem API 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