ShipNow LogoShipNow
支付

价格配置

学习如何在 ShipNow 应用中配置价格方案。

概述

ShipNow 使用灵活的价格配置系统,支持:

  • 💰 按月、按年订阅、一次性支付
  • 💵 显示多种价格组
  • 🎯 突出显示特色方案

配置结构

价格方案在翻译文件中配置(例如 messages/en.json)。以下是完整结构:

messages/en.json
{
  "pricing": {
    "groups": [
      {
        "name": "Monthly",
        "type": "monthly"
      },
      {
        "name": "Yearly (Save 20%)",
        "type": "yearly"
      },
      {
        "name": "One-time",
        "type": "oneTime"
      }
    ],
    "plans": [
      {
        "id": "basic",
        "name": "Basic",
        "description": "Perfect for getting started",
        "featured": false,
        "features": [
          "5 credits per month",
          "Basic support",
          "48-hour response time"
        ],
        "monthlyPricing": {
          "price": 10,
          "unit": "/month"
        },
        "yearlyPricing": {
          "price": 8,
          "unit": "/month"
        }
      }
      // ... 更多方案
    ]
  }
}

方案配置

每个方案支持以下选项:

核心属性

  • id: 方案的唯一标识符
  • name: 方案的显示名称
  • description: 方案的简短描述
  • featured: 是否突出显示此方案
  • features: 包含的功能数组

价格选项

方案可以有一个或多个价格类型:

  • monthlyPricing: 月付配置

    {
      "price": 10,
      "unit": "/月"
    }
  • yearlyPricing: 年付配置

    {
      "price": 8,
      "unit": "/月"  // 显示每月价格
    }
  • oneTimePricing: 一次性付款配置

    {
      "price": 100  // 一次性费用
    }

分组配置

分组允许你组织不同的价格选项:

{
  "name": "月付",    // 显示名称
  "type": "monthly"  // 价格类型
}

支持的分组类型:

  • monthly: 月付
  • yearly: 年付
  • oneTime: 一次性付款

显示规则

  1. 如果只有一个分组,分组切换器将隐藏
  2. 没有所选分组价格的方案将被隐藏
  3. 特色方案在界面中突出显示

多语言支持

添加或更新方案时:

  1. messages/en.json 中定义基础配置
  2. 复制并翻译到其他语言文件(如 messages/zh-CN.json
  3. 确保所有方案 ID 在各语言中匹配
  4. 更改方案结构时更新所有语言文件

支付链接

ShipNow 支持为任何价格类型配置直接支付链接。配置后,点击"立即购买"按钮将直接跳转到预配置的 Stripe 支付页面,不会创建新的结账会话。

配置方法

在任何价格配置中添加 link 属性:

{
  "oneTimePricing": {
    "price": 199,
    "unit": "",
    "link": "https://buy.stripe.com/test_14k6oIdPf9Km4k84gk?prefilled_promo_code=EARLYBIRD"
  }
}

使用场景

  • 为 "企业" 计划显示一个 "联系我们" 按钮,点击打开电子邮件。
  • 为新发布的产品创建一个限时优惠的支付链接,验证市场反应。

配置示例

基础订阅方案

{
  "id": "basic",
  "name": "基础版",
  "description": "适合入门使用",
  "featured": false,
  "features": ["每月 5 个积分"],
  "monthlyPricing": {
    "price": 10,
    "unit": "/月"
  },
  "yearlyPricing": {
    "price": 8,
    "unit": "/月"
  }
}

突出显示的专业版订阅方案

{
  "id": "pro",
  "name": "专业版",
  "description": "适合专业用户",
  "featured": true,
  "features": ["每月 50 个积分"],
  "monthlyPricing": {
    "price": 20,
    "unit": "/月"
  },
  "yearlyPricing": {
    "price": 16,
    "unit": "/月"
  }
}

一次性购买方案

{
  "id": "one-time",
  "name": "一次性",
  "description": "适合一次性付款",
  "featured": false,
  "features": ["100 个积分"],
  "oneTimePricing": {
    "price": 100
  }
}

支付链接方案

{
  "id": "early-bird",
  "name": "早鸟特惠",
  "description": "限时优惠",
  "featured": true,
  "features": [
    "终身访问权限",
    "优先支持",
    "早期用户权益"
  ],
  "oneTimePricing": {
    "price": 199,
    "unit": "",
    "link": "https://buy.stripe.com/test_14k6oIdPf9Km4k84gk?prefilled_promo_code=EARLYBIRD"
  }
}

On this page

ShipNow Logo获取 ShipNow