Stripe payments 条带:无计划api的定期付款

Stripe payments 条带:无计划api的定期付款,stripe-payments,Stripe Payments,我打算用Stripe处理信用卡 然而,我已经有了一个程序,可以根据客户对我们产品的订阅量来计算他们的月薪,因为计算非常复杂,所以我不想用Stripe的系统来重做整个事情 所以 是否可以在不使用Stripe的PLAN api的情况下重复向客户收费 如果是,我该如何实现这一目标 是的,您可以按条带方式向客户收费,而不必使用他们的订阅逻辑 要做到这一点,您需要在前端收集卡信息,然后将其保存到Stripe中的客户;您将在数据库中存储此客户的id 在向用户收费时,您可以让应用程序向您在Stripe中创建的

我打算用Stripe处理信用卡

然而,我已经有了一个程序,可以根据客户对我们产品的订阅量来计算他们的月薪,因为计算非常复杂,所以我不想用Stripe的系统来重做整个事情

所以

  • 是否可以在不使用Stripe的PLAN api的情况下重复向客户收费

  • 如果是,我该如何实现这一目标


  • 是的,您可以按条带方式向客户收费,而不必使用他们的订阅逻辑

    要做到这一点,您需要在前端收集卡信息,然后将其保存到Stripe中的客户;您将在数据库中存储此客户的id

    在向用户收费时,您可以让应用程序向您在Stripe中创建的客户的已保存卡收费

    # Create a Customer:
    customer = Stripe::Customer.create({
        source: 'tok_mastercard',
        email: 'paying.user@example.com',
    })
    
    # Charge the Customer instead of the card:
    charge = Stripe::Charge.create({
        amount: 1000,
        currency: 'usd',
        customer: customer.id,
    })
    
    # YOUR CODE: Save the customer ID and other info in a database for later.
    
    # When it's time to charge the customer again, retrieve the customer ID.
    charge = Stripe::Charge.create({
        amount: 1500, # $15.00 this time
        currency: 'usd',
        customer: customer_id, # Previously stored, then retrieved
    })
    
    查看更多信息