#NEWLINE# def confirm_ipn_data( data , PP_URL ) : #NEWLINE# #INDENT# newparams = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in data . keys ( ) : #NEWLINE# #INDENT# newparams [ key ] = data [ key ] #NEWLINE# #UNINDENT# newparams [ 'cmd' ] = '_notify-validate' #NEWLINE# params = urlencode ( req ) #NEWLINE# req = urllib2 . Request ( PP_URL ) #NEWLINE# req . add_header ( 'Content-type' , 'application/x-www-form-urlencoded' ) #NEWLINE# fo = urllib2 . urlopen ( req , params ) #NEWLINE# ret = fo . read ( ) #NEWLINE# if ( ret == 'VERIFIED' ) : #NEWLINE# #INDENT# log . info ( 'PayPal IPN data verification was successful.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . info ( 'PayPal IPN data verification failed.' ) #NEWLINE# log . debug ( ( "HTTP code %s, response text: '%s'" % ( fo . code , ret ) ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True