From cf9982c9c577289e590e146c99cead03f688cba0 Mon Sep 17 00:00:00 2001 From: fookenCode Date: Mon, 24 Jun 2019 23:54:28 -0700 Subject: [PATCH] Fixing parse_qsl query string output IPN Verification of payload requires that all keys and values are provided back to the VERIFY_URL. If any blank values are omitted, this will cause an otherwise valid payload to return 'INVALID' from the PayPal endpoint. Adding the 'keep_blank_values' argument will ensure that these elements will be added to the query string provided to PayPal to validate. --- python/paypal_ipn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paypal_ipn.py b/python/paypal_ipn.py index 221e8fb..a532119 100644 --- a/python/paypal_ipn.py +++ b/python/paypal_ipn.py @@ -18,7 +18,7 @@ # Read and parse query string param_str = sys.stdin.readline().strip() -params = urllib.parse.parse_qsl(param_str) +params = urllib.parse.parse_qsl(param_str, keep_blank_values=True) # Add '_notify-validate' parameter params.append(('cmd', '_notify-validate'))