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

Stripe Configuration

Configure Stripe payment

Stripe is the preferred payment solution for international markets, supporting credit cards, Apple Pay, Google Pay, and more.

Setup Steps

  1. Visit Stripe Dashboard
  2. Register and activate your account
  3. Get API keys

Environment Variables

STRIPE_SECRET_KEY="sk_live_xxx"
STRIPE_PUBLISHABLE_KEY="pk_live_xxx"
STRIPE_WEBHOOK_SECRET="whsec_xxx"
STRIPE_SUCCESS_URL="https://yourdomain.com/payment-success"
STRIPE_CANCEL_URL="https://yourdomain.com/payment-cancel"

Test Keys

Use test keys in development:

STRIPE_SECRET_KEY="sk_test_xxx"
STRIPE_PUBLISHABLE_KEY="pk_test_xxx"

Webhook Configuration

Set up Webhook in Stripe Dashboard:

  1. Developers → Webhooks → Add endpoint
  2. Endpoint URL: https://yourdomain.com/api/payment/stripe/webhook
  3. Select events to listen to

Events to Listen

  • checkout.session.completed
  • invoice.paid
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted

Configure Pricing

Subscription Mode

export const paymentConfig = {
  mode: 'subscription',
  subscriptionPlans: [
    {
      id: 'basic-monthly',
      name: 'Basic Monthly',
      price: 9.99,
      interval: 'month',
      stripePriceId: 'price_xxx',
      features: ['Feature 1', 'Feature 2'],
    }
  ]
}

One-time Payment

export const paymentConfig = {
  mode: 'one-time',
  oneTimePlans: [
    {
      id: 'starter',
      name: 'Starter',
      price: 99,
      stripePriceId: 'price_xxx',
      features: ['Lifetime access'],
    }
  ]
}

Payment Configuration

TinyShip payment system configuration guide

PayPal Configuration

Configure PayPal Payment

On this page

Setup StepsEnvironment VariablesTest KeysWebhook ConfigurationEvents to ListenConfigure PricingSubscription ModeOne-time Payment