【问题标题】:No attached payment source error when creating Stripe customer创建 Stripe 客户时没有附加付款来源错误
【发布时间】:2019-01-26 02:07:54
【问题描述】:

我正在尝试在这里学习一些教程,但遇到了一些错误。希望有人可以帮助我。

Stripe::InvalidRequestError in Users::RegistrationsController#create

This customer has no attached payment source

代码:

attr_accessor :stripe_card_token

def save_with_payment
  if valid?
    customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token)
    self.stripe_customer_token = customer.id
    save!
  end
end

【问题讨论】:

    标签: ruby-on-rails ruby stripe-payments


    【解决方案1】:

    您的请求的问题是,当您创建客户时,您发送的参数有误。

    应该是

    Stripe::Customer.create(description: email, plan: plan_id, source: stripe_card_token)

    查看here

    【讨论】:

    • 感谢您的回复@Kedarnag Mukanahallipatna...我在发布后几个小时后解决了它..
    猜你喜欢
    • 2017-03-13
    • 2018-12-13
    • 2018-11-07
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-14
    相关资源
    最近更新 更多