条带订阅 [英] Subscriptions in stripe

查看:42
本文介绍了条带订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读此https://stripe.com/docs/tutorials/subscriptions但并不真正理解订阅的实现方式.

I've read this https://stripe.com/docs/tutorials/subscriptions but don't really understand the idea of subscriptions in respect to implementation.

我需要的是向用户收费,但收费金额是我自己计算的,因为我有专门的算法.所以这段代码:

What I need is being to charge the user but the amount of charge is to be calculated by myself because I have a special algorithm for it. So this code:

 # create a plan - once!
  Stripe::Plan.create(
    :amount => 2000,
    :interval => 'month',
    :name => 'Amazing Gold Plan',
    :currency => 'cad',
    :id => 'gold'
  )


# every month? or also once?

maybe_customer = Stripe::Customer.retrieve(....)
unless maybe_customer
  customer = Stripe::Customer.create(
    :card => token,
    :plan => "gold",
    :email => "payinguser@example.com"
  )
end

何时(多久)我必须运行它:只一次或每个月(:interval => 'month')?

When (how often) do I have to run it: only once or every month (:interval => 'month')?

如果每个月,我会将其作为 cron 任务运行.但是如何让用户输入他们的信用卡详细信息呢?还是他们只需要第一次输入它们,然后我保存它们,然后就可以重新使用它们?

If every month, I'll run it as a cron task. But how to get the user to enter in their credit card details? Or do they have to enter them in only the first time, then I save them and then will be able to re-use them?

更新:

  1. 因为是订阅,所以会自动发生.这是否意味着它对用户完全是自动的?或者他们是否必须将他们的卡详细信息输入到 Stripe 一次的弹出窗口中,从那一刻起,它会自动对用户来说,这意味着他们不会有再输入他们的银行卡详细信息,他们将在每个月后自动按条收费?

  1. Since it's a subscription, it's to occur automatically. Does that mean that it's completely automatic for the user? Or do they have to enter their card details into the pop up from Stripe once and from that moment on it'll become automatic for the user, meaning they won't have to enter their bank card details anymore, they will be charged automatically by stripe each month later?

如果某些(我的)条件成立并使用 account_balance,如何向用户收取零美分作为月薪?从这个 https://support.stripe.com/questions/metered-subscription-billing 我不明白该怎么做.

How do charge the user zero cents as a monthly pay if some (my) condition is true and using account_balance? From this https://support.stripe.com/questions/metered-subscription-billing I don't understand how to do that.

我认为订阅和像正常付款一样向客户收费没有任何区别.如果这两种情况我都必须每月在服务器上运行一次代码.有什么区别?

I don't see any difference between a subscription and just charging a customer like if it were the normal payments. If both cases I have to run a code once a month on the server. What's the difference?

推荐答案

抱歉,我从你的问题中唯一能清楚地理解的是,你需要知道如何执行一次性付款而不是正确的订阅.

Sorry, but the only thing I could understand clearly from your question was that you need to know how to execute one-time payments rather than proper subscriptions.

>

阅读您分享的链接,我认为您应该能够设置一个 interval_count 选项,表示客户被收取费用的月数(或间隔).因此,将 interval_count 设置为 0 应该使付款只发生一次.

Reading the link you've shared, I've gathered that you should be able to set an interval_count option for the number of months (or intervals) after which the customer is charged. So setting interval_count to 0 should make the payment happen only once.

此外,这是来自同一页面:

Also, this is from the same page:

客户对象也可以存储信用卡,这就是它们的方式稍后结算.

Customer objects can also store a credit card, which is how they'll be billed later on.

换句话说,是的 - 客户第一次输入他/她的卡详细信息.您可以(可选?)将卡信息保存在 Customer 对象中.

In other words, yes - the customer enters his/her card details the first time. You can (optionally ?) save the card info in the Customer object.

这篇关于条带订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆