【发布时间】:2020-07-02 21:20:34
【问题描述】:
我为用户创建了一个捐赠应用程序。
- 使用 devise 和 stripe 添加了一个用户并使用用户登录凭据创建了客户。
- 然后创建了一个捐款页面,任何人都可以来捐款而无需注册。
下面是用户界面。
现在我想通过下面的代码用他的 customer_ID 向在 Bio:hello 注册的客户付款。
token = params[:stripeToken]
Stripe::Charge.create(
customer: @user.stripe_id,
source: token,
amount: 2000,
currency: 'usd',
description: 'Example charge'
)
But its throwing error. Stripe::InvalidRequestError: Customer cus_** does not have a linked source with ID tok_**.
请帮助我如何在不向该用户注册帐户的情况下捐款。
【问题讨论】:
标签: stripe-payments strip