From 294537f084ad617ed8b5df30d25f8c0df6fa3e98 Mon Sep 17 00:00:00 2001 From: Brendten Eickstaedt Date: Wed, 6 Mar 2013 11:20:31 -0500 Subject: [PATCH] Changed AmazonFlexPay call to fix method_not_found --- app/controllers/preorder_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/preorder_controller.rb b/app/controllers/preorder_controller.rb index b11d26930..09d051b6c 100644 --- a/app/controllers/preorder_controller.rb +++ b/app/controllers/preorder_controller.rb @@ -24,15 +24,13 @@ def prefill # This is where all the magic happens. We create a multi-use token with Amazon, letting us charge the user's Amazon account # Then, if they confirm the payment, Amazon POSTs us their shipping details and phone number # From there, we save it, and voila, we got ourselves a preorder! - @pipeline = AmazonFlexPay.multi_use_pipeline(@order.uuid, + port = Rails.env.production? ? "" : ":3000" + callback_url = "#{request.scheme}://#{request.host}#{port}/preorder/postfill" + redirect_to AmazonFlexPay.multi_use_pipeline(@order.uuid, callback_url, :transaction_amount => price, :global_amount_limit => price + Settings.charge_limit, :collect_shipping_address => "True", :payment_reason => Settings.payment_description) - - - port = Rails.env.production? ? "" : ":3000" - redirect_to @pipeline.url("#{request.scheme}://#{request.host}#{port}/preorder/postfill") end def postfill