Issue 193: Refactor PayPal IPN code in Order.rb
Status:  Fixed
Owner:
Closed:  Feb 2010
Project Member Reported by subim...@gmail.com, Dec 25, 2009
The PayPal IPN methods are a bit strange in Order.rb. In each of them, you're passing in an order 
object.

This seems like a "duh" candidate to be an instance method. Anyone see a reason it shouldn't be 
switched?

Additionally, "matches_ipn" looks like it should be a ? method.

For example, take the following code in PaypalController

{{{
        if notification.complete? && 
          Order.matches_ipn(notification, order, params) 
          Order.pass_ipn(order, params[:txn_id])
        else
          Order.fail_ipn(order)
        end
}}}

Would be much cleaner as the following.

{{{
if notification.complete? && order.matches_ipn?(notification) 
  order.pass_ipn(params[:txn_id])
else
  order.fail_ipn()
end

}}}
Feb 6, 2010
Project Member #1 subim...@gmail.com
Resolved with r205
Status: Fixed