Kashif Ghaffar
Kashif Ghaffar

Reputation: 47

Stripe Customer creation issues In Rails 3

I used stripe for payment but customer not created. Please help me.

customer = Stripe::Customer.create(
    :card => token,
    :plan => "1",
    :description => email
  )

Upvotes: 1

Views: 37

Answers (1)

Ajay
Ajay

Reputation: 4251

Make sure you have gem 'stripe' in your Gemfile.

Then try this from your console :

require "stripe" 
Stripe.api_key = "sk_test_KT791S3jh1y5t5xdnW6bjBln" 

Stripe::Customer.create( 
  :email => '[email protected]'
  :description => "Customer for [email protected]", 
  :metadata => {
   "first_name" =>  "John", 
   "last_name" => "Pinto"
  }
)

Check this link for more info on creating customer.

Upvotes: 1

Related Questions