title: Braintree integration with Rails (no switch to production)
body: <p>i have an app using braintree payments. I followed the instructions from their site and the sandbox works fine. But in production when i change the api keys with the production keys it still remain the sand box. 
  This is the form i use for the payments:</p>
  
  <pre><code>&lt;form id="checkout" method="post" action="/checkout"&gt;
      &lt;div id="payment-form"&gt;&lt;/div&gt;
      &lt;input type="submit" class="btn btn-primary check_out" value="Pay"&gt;
  &lt;/form&gt;
  &lt;script src="https://js.braintreegateway.com/js/braintree-2.27.0.min.js"&gt;&lt;/script&gt;
              &lt;script&gt;
                  var clientToken = "&lt;%= @token %&gt;";
                  braintree.setup(clientToken, "dropin", {
                      container: "payment-form"
                  });
              &lt;/script&gt;
  </code></pre>
  
  <p>and this is the controller code:</p>
  
  <pre><code>def checkout
    @order_items = current_order.order_items
    @order = current_order
    @token = Braintree::ClientToken.generate
    amount = @order.total
    nonce = params["payment_method_nonce"]
  
    result = Braintree::Transaction.sale(
      amount: amount,
      payment_method_nonce: nonce,
      :options =&gt; {
        :submit_for_settlement =&gt; true
      }
    )
    if result.success? || result.transaction
      @order.order_status_id = 2
      @order.save
      OrderMailer.order_placed(@order).deliver
      session[:order_id] = @order.id
      session.delete :order_id
      flash[:notice] = 'success'
      redirect_to root_path
    else
  
    end
  end
  </code></pre>
  
  <p>for passing api keys i am using an .env file and the dotenv gem. I deploy this app with Capistrano and i checked the existence of the .env file and if it contains the correct api keys and everything is fine.</p>