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

I am trying to allow a user to add a credit card to my application 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 documents obsolete 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:... 
+4
source share
2 answers

Support for creating maps has been added to stripe version 1.8.4. You need to make sure that you are using this version or newer, otherwise you will see this error.

+6
source

I solved this by replacing: gem "stripe" in my gemfile: gem 'stripe' ,: git => ' https://github.com/stripe/stripe-ruby ' and then the node is started. It worked fine, and then threw this error out of nowhere, but the update seems to fix it.

+2
source

Source: https://habr.com/ru/post/1492217/


All Articles