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

This commit is contained in:
Jesse Grant
2013-01-14 16:53:44 -05:00
parent 7fdb605e8e
commit c49524edd0

View File

@@ -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