调至内容部分
创建账户或登录
Stripe 文档徽标
/
询问人工智能
创建账户登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员资源
API 和 SDK帮助
概览
Billing
概览关于 Billing API
订阅
    概览
    订阅的运作机制
    开始
    快速开始
    规划集成
    构建集成
    与 Salesforce 集成
    用例
    关于订阅
    启用开单模式
    配置订阅事件
    资格
    订阅账单
    订阅计划
    经常性定价模型
    设置订阅
    配置收取方法
    嵌入价格表
    设置计费周期
    管理订阅
    将订阅迁移到 Stripe
    设置产品或订阅数量
    混合间隔订阅
    回溯订阅
    设置试用期
    处理延期付款的订阅
    使用优惠券
    修改订阅
    管理订阅支付方式
      按 ACH 直接借记额收取
      Amazon Pay
      英国的 BACS 直接借记
      银行转账
      澳大利亚的 BECS 直接借记
      Cash App Pay
      Klarna
      PayPal
      Revolut Pay
      韩国卡
      Kakao Pay
      Naver Pay
      加拿大预授权借记
      欧盟的 SEPA 直接借记
      稳定币
      使用 SEPA 直接借记的 iDEAL
      使用 SEPA 直接借记的 Bancontact
    分析
    管理 iOS 上的订阅
开账单
基于用量的计费
高级用量计费
报价
客户管理
用其他产品计费
收入恢复
自动化
测试您的集成
税务
概览
使用 Stripe Tax
管理合规
报告
概览
选择报告
配置报告
多账户报告
Reports API
收入确认
数据
概览
查询商家数据
Sigma
Data Pipeline
导入外部数据
美国
简体中文
首页销售收入SubscriptionsManage subscription payment methods

Set up a subscription with stablecoin payments私人预览

Learn how to create and charge for a subscription with stablecoins.

Use this guide to set up a subscription that withdraws recurring stablecoin payments from a customer’s crypto wallet.

Create a product and price
Dashboard

Products represent the item or service you’re selling. Prices define how much and how frequently you charge for a product. This includes how much the product costs, what currency you accept, and whether it’s a one-time or recurring charge. If you only have a few products and prices, create and manage them in the Dashboard.

This guide uses a stock photo service as an example and charges customers a 15 USD monthly subscription. To model this:

  1. Go to the Products page and click Create product.
  2. Enter a Name for the product. You can optionally add a Description and upload an image of the product.
  3. Select a Product tax code. Learn more about product tax codes.
  4. Select Recurring. Then enter 15 for the price and select USD as the currency.
  5. Choose whether to Include tax in price. You can either use the default value from your tax settings or set the value manually. In this example, select Auto.
  6. Select Monthly for the Billing period.
  7. Click More pricing options. Then select Flat rate as the pricing model for this example. Learn more about flat rate and other pricing models.
  8. Add an internal Price description and Lookup key to organize, query, and update specific prices in the future.
  9. Click Next. Then click Add product.

After you create the product and the price, record the price ID so you can use it in subsequent steps. The pricing page displays the ID and it looks similar to this: price_G0FvDp6vZvdwRZ.

Create a Checkout Session
Server-side

Your customer must authorize you to use their crypto wallet for future payments through Stripe.

Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

index.html
<html> <head> <title>Checkout</title> </head> <body> <form action="/create-checkout-session" method="POST"> <button type="submit">Checkout</button> </form> </body> </html>

Create a Checkout Session in subscription mode to collect the required information. After creating the Checkout Session, redirect your customer to the URL that the response returns.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ --data-urlencode success_url="https://example.com/success" \ -d "line_items[0][price]"={{RECURRING_PRICE_ID}} \ -d "line_items[0][quantity]"=1 \ -d "payment_method_types[0]"=crypto \ -d mode=subscription

Confirm the payment is successful

When your customer completes a payment, Stripe redirects them to the URL that you specified in the success_url parameter. Typically, this is a page on your website that informs your customer that their payment was successful.

After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded.

You can confirm the payment is successful in several ways:

Successful payments display in the Dashboard’s list of payments. When you click a payment, it takes you to the payment details page. The Checkout summary section contains billing information and the list of items purchased, which you can use to manually fulfill the order.

注意

Stripe can help you keep up with incoming payments by sending you email notifications whenever a customer successfully completes one. Use the Dashboard to configure email notifications.

Test your integration

Test your crypto payment integration by opening the payment redirect page using your test API keys. You can test a successful payment flow at no cost using testnet assets.

  1. In a sandbox, create a new transaction using your chosen integration method, and open its redirect URL.
  2. Connect your preferred wallet and payment network.
  3. Complete the payment, and validate that you’re redirected to the expected URL.

Test payments with testnet assets

Most cryptocurrencies offer testnet assets, or tokens that have no monetary value, that you can use to test blockchain transactions. Stripe recommends the MetaMask wallet, Polygon Amoy testnet, and Circle faucet for testing, but you can use your own preferred services.

Install a wallet

  1. Download the MetaMask extension for your web browser.
  2. Create a new wallet or import an existing one.

Enable a testnet

  1. In your MetaMask wallet, select Networks from the main menu.
  2. Click Add custom network.
  3. Enter the following details:
    • Network name: Polygon Amoy
    • Default RPC URL: https://rpc-amoy.polygon.technology/
    • Chain ID: 80002
    • Currency symbol: POL
    • Block explorer URL: https://amoy.polygonscan.com/
  4. Click Save.

Import a token

  1. In your MetaMask wallet, under Tokens, select Polygon Amoy from the network dropdown.
  2. Click the overflow menu (), and select Import tokens.
  3. Click Select a network > Polygon Amoy.
  4. Under Token contract address, paste the Polygon Amoy testnet contract address:
    0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582
    The Token symbol field automatically updates with USDC and the Decimals field with 6.
  5. Click Next.
  6. Verify that you’re importing the USDC token, and then click Import.

Your MetaMask wallet now shows Polygon Amoy and USDC in the tokens list.

Get testnet assets

  1. Open faucet.circle.com
  2. Click USDC.
  3. Under Network, select Polygon PoS Amoy.
  4. Under Send to, paste your wallet address.
  5. Click Send 10 USDC.

In addition to USDC for making payments, you need POL to pay transaction costs:

  1. Open faucet.polygon.technology.
  2. Under Select Chain & Token, select Polygon Amoy and POL.
  3. Under Verify your identity, click the third-party platform you want to authenticate with, and complete the login process.
  4. Under Enter Wallet Address, paste your wallet address.
  5. Click Claim.

Testnet transactions can take a few minutes to complete. Check your wallet to confirm that the USDC and POL has transferred.

More testnet faucets

Check these faucet services for more testing token options:

  • Paxos USDP
  • Devnet SOL
  • Sepolia ETH
  • Amoy POL
此页面的内容有帮助吗?
是否
  • 需要帮助?联系支持。
  • 查看我们的更改日志。
  • 有问题?联系销售。
  • LLM? Read llms.txt.
  • Powered by Markdoc
相关指南
Accept stablecoin payments