I have created an donation app for user.
- Added a user and created customer with user login credentials using devise and stripe.
- Then Created a donation page where anyone can come and donate money without registering.
Below is the UI.
Now I want to pay the customer which is registered with Bio:hello with his customer_ID by below code.
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_**.
PLease help me how to donate some amount without registering my account to this user.