【发布时间】: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