Commits

NikolayBlohin committed c9d0b77

Fixed checkout view.

  • Participants
  • Parent commits 0859dde

Comments (0)

Files changed (1)

File lfs/checkout/views.py

 
             # Only if the payment is succesful we create the order out of the
             # cart.
-            if result.get("success") == True:
+            if result["accepted"] == True:
                 order = lfs.order.utils.add_order(request)
-
-                # TODO: Get rid of these payment specific payment stuff. This
-                # should be within payment utils.
-                if payment_method.id == PAYPAL and settings.LFS_PAYPAL_REDIRECT:
-                    return HttpResponseRedirect(order.get_pay_link())
-                else:
-                    return HttpResponseRedirect(result.get("next-url"))
+                return HttpResponseRedirect(
+                    result.get("next-url", reverse("lfs_thank_you")))
             else:
                 if result.has_key("message"):
-                    form._errors[result.get("message-key")] = result.get("message")
+                    form._errors[result.get("message-position")] = result.get("message")
         
         else: # form is not valid
             # Create or update invoice address