From c49524edd0080b5ffbe3e025d9ec003adc37f2bb Mon Sep 17 00:00:00 2001 From: Jesse Grant Date: Mon, 14 Jan 2013 16:53:44 -0500 Subject: [PATCH] added code so that port will be used if you are not in production mode so that you can test amazon flexible payments end to end in development --- app/controllers/preorder_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/preorder_controller.rb b/app/controllers/preorder_controller.rb index 0801bf4..b11d269 100644 --- a/app/controllers/preorder_controller.rb +++ b/app/controllers/preorder_controller.rb @@ -26,11 +26,13 @@ class PreorderController < ApplicationController # From there, we save it, and voila, we got ourselves a preorder! @pipeline = AmazonFlexPay.multi_use_pipeline(@order.uuid, :transaction_amount => price, - :global_amount_limit => Settings.charge_limit, + :global_amount_limit => price + Settings.charge_limit, :collect_shipping_address => "True", :payment_reason => Settings.payment_description) - redirect_to @pipeline.url("#{request.scheme}://#{request.host}/preorder/postfill") + + port = Rails.env.production? ? "" : ":3000" + redirect_to @pipeline.url("#{request.scheme}://#{request.host}#{port}/preorder/postfill") end def postfill