Skip to content

Commit

Permalink
Changed AmazonFlexPay call to fix method_not_found
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendten Eickstaedt committed Mar 6, 2013
1 parent da2d021 commit 294537f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/controllers/preorder_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 294537f

Please sign in to comment.