@require_POST
def ipn(request, item_check_callable=None):
 flag = None
 ipn_obj = None
 form = PayPalIPNForm(request.POST)
 if form.is_valid():
  try:
   ipn_obj = form.save(commit=False)
  except Exception as e:
   flag = ('Exception while processing. (%s)' % e)
 else:
  flag = ('Invalid form. (%s)' % form.errors)
 if (ipn_obj is None):
  ipn_obj = PayPalIPN()
 ipn_obj.initialize(request)
 if (flag is not None):
  ipn_obj.set_flag(flag)
 elif (request.is_secure() and ('secret' in request.GET)):
  ipn_obj.verify_secret(form, request.GET['secret'])
 else:
  ipn_obj.verify(item_check_callable)
 ipn_obj.save()
 return HttpResponse('OKAY')

@ require_POST def ipn ( request , item_check_callable = None ) : flag = None ipn_obj = None form = PayPalIPNForm ( request . POST ) if form . is_valid ( ) : try : ipn_obj = form . save ( commit = False ) except Exception as e : flag = ( 'Exception while processing. (%s)' % e ) else : flag = ( 'Invalid form. (%s)' % form . errors ) if ( ipn_obj is None ) : ipn_obj = PayPalIPN ( ) ipn_obj . initialize ( request ) if ( flag is not None ) : ipn_obj . set_flag ( flag ) elif ( request . is_secure ( ) and ( 'secret' in request . GET ) ) : ipn_obj . verify_secret ( form , request . GET [ 'secret' ] ) else : ipn_obj . verify ( item_check_callable ) ipn_obj . save ( ) return HttpResponse ( 'OKAY' )
paypal ipn endpoint .