在 Rails 上免费订阅 Stripe - 无需卡即可获取令牌
Free subscription with Stripe on Rails - Get token without card
我正在使用 Rails-Stripe-Membership-SaaS which makes use of Payola. Payola assumes you want to create an immediately charging subscription. This means free plans and plans with free trials require a credit card at sign up. I'd like to get around this. I've made a fork here: https://github.com/archonic/payola
我感到困惑的是如何完成第一步的具体细节:
Stripe - How to handle subscription with a free plan and no credit card required at sign up time
对于免费计划或试用计划,Stripe 不需要卡片,但我不确定如何在没有卡片的情况下创建令牌。在调用 create_customer 之前,如何仅通过电子邮件获取令牌?
创建客户不需要令牌。只需继续并像这样调用创建客户 API:
customer = Stripe::Customer.create(
email: "test@example.com",
description: "...something..."
)
# do something with customer, save id in db/etc
您可以为该客户订阅一个免费试用的计划,而无需附加卡。只要计划有免费试用,您甚至可以在创建客户电话中传递 plan: 'someplan'
。
我正在使用 Rails-Stripe-Membership-SaaS which makes use of Payola. Payola assumes you want to create an immediately charging subscription. This means free plans and plans with free trials require a credit card at sign up. I'd like to get around this. I've made a fork here: https://github.com/archonic/payola
我感到困惑的是如何完成第一步的具体细节: Stripe - How to handle subscription with a free plan and no credit card required at sign up time
对于免费计划或试用计划,Stripe 不需要卡片,但我不确定如何在没有卡片的情况下创建令牌。在调用 create_customer 之前,如何仅通过电子邮件获取令牌?
创建客户不需要令牌。只需继续并像这样调用创建客户 API:
customer = Stripe::Customer.create(
email: "test@example.com",
description: "...something..."
)
# do something with customer, save id in db/etc
您可以为该客户订阅一个免费试用的计划,而无需附加卡。只要计划有免费试用,您甚至可以在创建客户电话中传递 plan: 'someplan'
。