Permalink
Browse files

success_url should be taken from config. order doesn't have writable …

…ip_address anymore
  • Loading branch information...
1 parent cb36910 commit e69b1baaa1572e690005d53176dc792a4fa2dd85 @tomash tomash committed Nov 12, 2010
Showing with 6 additions and 3 deletions.
  1. +5 −2 app/controllers/paypal_payments_controller.rb
  2. +1 −1 app/views/checkout/_paypal_checkout.html.erb
@@ -55,8 +55,11 @@ class PaypalPaymentsController < Spree::BaseController
end
# Action for handling the "return to site" link after user completes the transaction on the Paypal website.
- def successful
- @order.update_attribute("ip_address", request.env['REMOTE_ADDR'] || "unknown")
+ def successful
+ # order doesn't have ip_address writable attribute now
+ # @order.update_attribute("ip_address", request.env['REMOTE_ADDR'] || "unknown")
+
+
# its possible that the IPN has already been received at this point so that
if @order.paypal_payments.empty?
# create a payment and record the successful transaction
@@ -28,7 +28,7 @@
<input type="hidden" name="upload" value="1" />
<input id="notify_url" name="notify_url" type="hidden" value="<%= Spree::Paypal::Config[:ipn_notify_host] + order_paypal_payments_path(@order) %>" />
<input type="hidden" name="rm" value ="2"> <!-- tells paypal that the return should be POST instead of GET -->
- <input id="return" name="return" type="hidden" value="<%= successful_order_paypal_payments_url(@order) %>" />
+ <input id="return" name="return" type="hidden" value="<%= Spree::Paypal::Config[:success_url] %>" />
<!-- input id="address_override" name="address_override" type="hidden" value="0" />
<input id="charset" name="charset" type="hidden" value="utf-8" />

0 comments on commit e69b1ba

Please sign in to comment.