Josh VanderLinden avatar Josh VanderLinden committed 40d3711

Adding some debug

Comments (0)

Files changed (1)

 diff --git a/satchmo/apps/payment/modules/genericemail/views.py b/satchmo/apps/payment/modules/genericemail/views.py
 --- a/satchmo/apps/payment/modules/genericemail/views.py
 +++ b/satchmo/apps/payment/modules/genericemail/views.py
+@@ -3,9 +3,9 @@
+ from django.http import HttpResponseRedirect
+ from django.shortcuts import render_to_response
+ from django.template import RequestContext
+-from livesettings import config_get_group, config_value
+-from payment.views import confirm, payship
+-from satchmo_store.shop.models import Cart, Order, OrderPayment
++from livesettings import config_value
++from payment.views import payship
++from satchmo_store.shop.models import Cart, Order
+ from satchmo_utils.dynamic import lookup_url, lookup_template
+ 
+ from dv.gifts.models import Gift
 @@ -16,7 +16,8 @@
      return payship.simple_pay_ship_info(request,
          config, 'shop/checkout/%s/pay_ship.html' % module)
 new file mode 100644
 --- /dev/null
 +++ b/satchmo/apps/payment/modules/moneybookers/views.py
-@@ -0,0 +1,143 @@
+@@ -0,0 +1,150 @@
 +import logging
 +import traceback
 +
 +from satchmo_store.shop.models import Cart, Order, OrderPayment
 +from satchmo_utils.dynamic import lookup_url, lookup_template
 +
-+log = logging.getLogger()
++log = logging.getLogger('moneybookers.views')
 +
 +@never_cache
 +def pay_ship_info(request):
 +    else:
 +        account = config.BUSINESS_TEST.value
 +
++    log.debug('Using moneybookers account: %s' % (account,))
++
 +    try:
 +        order = Order.objects.from_request(request)
 +    except Order.DoesNotExist:
++        log.error('Failed load order from request: %s' % (request,))
 +        url = lookup_url(config, 'satchmo_checkout-step1')
 +        return HttpResponseRedirect(url)
 +
 +    tempCart = Cart.objects.from_request(request)
 +    if tempCart.numItems == 0 and not order.is_partially_paid:
++        log.warning('Cart is empty!')
 +        template = lookup_template(config, 'shop/checkout/empty_cart.html')
 +        return render_to_response(template, context_instance=RequestContext(request))
 +
 +
 +    # Check if the order is still valid
 +    if not order.validate(request):
++        log.error('Order %s is no longer valid.' % (order,))
 +        context = RequestContext(request, {
 +            'message': _('Your order is no longer valid.')
 +        })
 +
 +    from payment.views.checkout import success
 +
++    log.debug('Order success!')
 +    response = success(request)
 +    try:
 +        order = Order.objects.from_request(request)
 +    except Order.DoesNotExist:
-+        pass
++        log.info('Order could not be loaded from request: %s' % (request,))
 +    else:
++        log.debug('Calling order_success on %s' % (order,))
 +        order.order_success()
 +
 +    return response
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.