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