Stripe Payment Works on LocalHost but Does not work on Heroku
<p>Hope all is good 
I am baffled by why my stripe payment in ruby on rails works on my localhost which is c9.io account but when I deployed my code in Heroku, it gives me this error:</p>

<blockquote>
  <p>Cannot charge a customer that has no active card</p>
</blockquote>

<p>my orders.coffee file: </p>

<pre><code>jQuery -&gt;
  Stripe.setPublishableKey($('meta[name="stripe-key"]').attr('content'))
  payment.setupForm()

payment =
  setupForm: -&gt;
    $('#new_order').submit -&gt;
      $('input[type=submit]').attr('disabled', true)
      obj = Stripe.card.createToken($('#new_order'), payment.handleStripeResponse)
      alert(JSON.stringify(obj));

  handleStripeResponse: (status, response) -&gt;
    if status == 200
      $('#new_order').append($('&lt;input type="hidden" name="stripeToken" /&gt;').val(response.id))
      $('#new_order')[0].submit()
    else
      $('#stripe_error').text(response.error.message).show()
      $('input[type=submit]').attr('disabled', false)
</code></pre>

<p>out come of my orders.coffee in localhost:</p>

<p><a href="https://i.stack.imgur.com/MMv9h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MMv9h.png" alt="enter image description here"></a></p>

<p>my application.html.erb header section</p>

<pre><code>&lt;head&gt;
  &lt;title&gt;Estydemo&lt;/title&gt;
  &lt;%= stylesheet_link_tag    'application', media: 'all'%&gt;
  &lt;%= javascript_include_tag  'https://js.stripe.com/v2/', type: 'text/javascript' %&gt; 
  &lt;%= javascript_include_tag 'application' %&gt;
  &lt;%= csrf_meta_tags %&gt;
  &lt;%= tag :meta, :name=&gt; 'stripe-key', :content =&gt; STRIPE_PUBLIC_KEY %&gt;
&lt;/head&gt;
</code></pre>

<p>my orders_controller.rb stripe section:</p>

<pre><code>Stripe.api_key = ENV["stripe_api_key"]
    #flash[:notice] = Stripe.api_key
    #puts "stripe api key is " + Stripe.api_key
    token = params[:stripeToken]

    begin
      customer = Stripe::Customer.create(
        :source  =&gt; token,
        :description =&gt; "Customer.create"
        )
      charge = Stripe::Charge.create(
        :amount =&gt; (@listing.price * 100).floor,
        :description =&gt; 'charge.create',
        :currency =&gt; "usd",
        :customer    =&gt; customer.id
        )
      flash[:notice] = "Thanks for ordering!"
    rescue Stripe::CardError =&gt; e
       flash[:danger] = e.message
    end
</code></pre>

<p>my application.js </p>

<pre><code>// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
</code></pre>

<p>my stripe dashboard for a sample where I get from heroku</p>

<p><a href="https://i.stack.imgur.com/GTYtj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GTYtj.png" alt="enter image description here"></a></p>

<p>Could anyone let me know why I have such an odd issue?
left one is from heroku and right one is from localhost
<a href="https://i.stack.imgur.com/ThTiQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ThTiQ.png" alt="enter image description here"></a>
If there is more info needed, please ask it away.</p>