RuntimeError at /checkout/protx/confirm/ - maximum recursion depth exceeded in cmp

Issue #989 resolved
Kevin Golding created an issue

Further to <<issue 985>> when the card is saved it appears to hit a recursion problem

Traceback: File "/usr/local/lib/python2.6/site-packages/django/core/handlers/" in get_response 92. response = callback(request, callback_args, *callback_kwargs) File "/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/modules/protx/" in confirm_info 25. controller.confirm() File "/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/views/" in confirm 96. self.response = self.onForm(self) File "/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/modules/protx/" in secure3d_form_handler 81. return controller.onForm(controller)

8< snip repeated error 8<

File "/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/modules/protx/" in secure3d_form_handler 81. return controller.onForm(controller) File "/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/modules/protx/" in secure3d_form_handler 72. if controller.processorReasonCode == '3DAUTH':

Exception Type: RuntimeError at /checkout/protx/confirm/ Exception Value: maximum recursion depth exceeded in cmp

Comments (15)

  1. Kevin Golding reporter

    Just thougt I should include the log for one of those requests:

    processor=<module 'payment.modules.protx.processor' from '/usr/local/lib/python2.6/site-packages/Satchmo-1.0_pre-py2.6.egg/payment/modules/protx/processor.pyc'>;

    getting form from module

    Getting shipping methods: ['shipping.modules.per']

    Card holder OK

    Getting shipping methods: ['shipping.modules.per']

    Order #9, recalc: sub_total=$5.84, shipping=$4.00, discount=$0.00, tax=$1.72

    Found pending payment: Order Pending Payment #24

    Deleting 1 expired pending payment entries for order #9

    Creating pending PROTX payment of 0.00 for Order #9: Kevin Golding

    Pending Payment - creating linked payment

    data: {'month_start': None, 'month_expires': 4, 'year_start': None, 'ccv': u'567', 'issue_num': None, 'shipping': u'PerItem', 'credit_type': u'VISA', 'credit_number': u'4111111111111111', 'year_expires': 2010, 'card_holder': None}

  2. Tay Ray Chuan

    Examining the code paths again, yes, the issue is still there.

    secure3d_form_handler invokes controller.onForm, when it already has been set to secure3d_form_handler, resulting in an infinite loop - at least, on the surface. controller.onForm might be changed along the way, but I doubt it.

  3. Former user Account Deleted

    This issue is still appearing - tested with 0.9.1

    Any idea for potential fix? I need to make use of protx module, but don't quite know where to start to resolve it.

  4. Chris Moffitt repo owner

    rctay's comments seem to be correct. If 3Dauth isn't returned, then it tries to return the controller which in turn causes the recursive condition. I'm not familiar enough with Protx to understand what should be happening here. The good news is that it all comes down to the initial call here - and the function here -

    The solution is figuring out what the secure_3d_form should return if the 3DAUTH code isn't called.

  5. Maciek Szczesniak

    It seems 3dauth handler is incomplete as shop/checkout/secure3d_form.html is missing. If you do not require 3dauth verification, commenting out line 24 in protx/ does the job.

  6. Former user Account Deleted

    I have the current 0.9.2 version and have just come across this issue so I can confirm it is still a problem.

  7. Sophie Hume

    Still an issue, but I'm working on a fix. The quick fix for this particular bug is to change this line:

    to return the controller's 'base' method, ie: return controller._onForm(controller)

    But apart from the fact that it seems non-pythonic to call into a 'hidden' method like that, fixing this just opens a whole can of worms as there's a bunch of other bugs that stop 3d secure from functioning in this module. I'm fixing them in the next few days, will come back soon...

  8. Former user Account Deleted

    Chris - I encountered the same problem, and your fix resolved it. The issue is if 3D secure isn't setup by sagepay.

  9. Stuart Axon


    Still had this problem using bitbucket version (9.3), using the fix by @hellosunshine fixes it + you get an error message about whatever is wrong as opposed to hitting the recursion ( rrr.. ate about a day trying to get to the bottom of this!)

    @hellosunshine 's fix - return:

    return controller._onForm(controller)

    instead of:

    return controller.onForm(controller)

    ...of course, maybe I'm using the wrong version from BB and there is a fix already there that I missed..

  10. Log in to comment