0
votes

I have created an donation app for user.

  1. Added a user and created customer with user login credentials using devise and stripe.
  2. Then Created a donation page where anyone can come and donate money without registering.

Below is the UI.

Donation_list

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.

1

1 Answers

0
votes