Skip to content

Commit

Permalink
Added resending signals when CLICKBANK_DEBUG is on, also adding logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Sureiya committed Nov 14, 2013
1 parent bfe0851 commit 879dd7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django_clickbank/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ def ipn(request, get=False):
if form.errors['receipt'][0] == u'Notification with this Receipt already exists.':
notification = Notification.objects.get(receipt=form.data['receipt'])
logger.info('Notification recognized as duplicate. Returning OK.')
if settings.CLICKBANK_DEBUG:
logger.debug('Resending Signals')
notification.send_signals()
return HttpResponse(notification.id)
raise NotificationFailedValidation('{0}\n{1}\n{2}'.format(form.errors, mapped_data, data))

notification.initialize(request)
notification.verification_passed = verification
notification.save()

notification.send_signals()
logger.info('Notification Processed Succesfully:')
logger.info('Source: {0} Receipt: {1} Type: {2} Vendor: {3} Affiliate: {4} Product: {5}'.format(
notification.sender_ip, notification.receipt, notification.transaction_type,
Expand Down

0 comments on commit 879dd7c

Please sign in to comment.