Permalink
Browse files

Fix bug order.payment.complete method not found. Added code to add pa…

…yment method on ipn notification.
  • Loading branch information...
1 parent 3cf61ec commit cf6d8597cd5666bddef0c0df52ba1885d153942a @mutalis committed Feb 21, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 app/controllers/payment_notifications_controller.rb
@@ -14,6 +14,14 @@ def create
Order.transaction do
# main part of hacks
order = @order
+
+ #create payment for this order
+ payment = Payment.new
+ payment.amount = order.total
+ payment.payment_method = Order.paypal_payment_method
+ order.payments << payment
+ payment.started_processing
+
order.payment.complete
logger.info("order #{order.number} (#{order.id}) -- completed payment")
while order.state != "complete"

0 comments on commit cf6d859

Please sign in to comment.