Using the paypal IPN I am getting a problem when validating the payment.
Paypal returns to the Python/Django site that started the original transaction with payer_status as unverified. The site is then posting back to 'https://www.paypal.com/cgi-bin/webscr' with all the post parameters and 'cmd' parameter set to '_notify-validate' to verify the payment. PayPal IPN returns as INVALID.
Is this correct or is it something I have missed?
It uses the Requests Python HTTP library. I don't think its the code as most transactions are verified ok.
def paypalIPN(request):
post_content = dict(request.POST.copy())
return_data = {'cmd':'_notify-validate'}
if not post_content.keys():
raise Http404("Post not found")
for key in post_content.keys():
return_data[key]=post_content[key][0]
paypal_url = "https://www.paypal.com/cgi-bin/webscr"
response = requests.post(paypal_url, data=return_data)