Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe undefined method `create' for #<Stripe::ListObject:

I'm trying to allow a user to add a credit card in my app using Stripe. When i call the code below (which is from the docs: https://stripe.com/docs/api#create_card), I get the error below.

Are the docs out of date or am i doing something wrong?

@card = Stripe::Customer.retrieve(current_account.stripe_id).cards.create(:card => params[:stripeToken])

undefined method `create' for #<Stripe::ListObject:...
like image 838
Catfish Avatar asked Feb 16 '23 21:02

Catfish


1 Answers

Support for creating a card was added in version 1.8.4 of the Stripe gem. You'll need to make sure you're using that version or newer, otherwise you'll see that error.

like image 131
brian Avatar answered Feb 22 '23 22:02

brian