404 Error with Paypal IPN Link "https://ipnpb.paypal.com/cgi-bin/webscr"

foreandr
Member
Member

I am trying to set up a notification from on a payment. Here is my code:

def PayPal_IPN():
    print("REQUESt:    ", request)
    print("REQUESt INFO: ",request.data)
   
    '''This module processes PayPal Instant Payment Notification messages (IPNs).'''

    # Switch as appropriate
    VERIFY_URL_PROD = 'https://ipnpb.paypal.com/cgi-bin/webscr'
    VERIFY_URL = VERIFY_URL_PROD

    # Read and parse query string
    params = request.form.to_dict()

    # Add '_notify-validate' parameter
    params['cmd'] = '_notify-valudate'

    # Post back to PayPal for validation

    headers = {'content-type': 'application/x-www-form-urlencoded',
               'user-agent': 'Python-IPN-Verification-Script'}
    r = requests.post(VERIFY_URL, params=params, headers=headers, verify=True)
    r.raise_for_status()

    # Check return message and take action as needed
    if r.text == 'VERIFIED':
        print("SUCCESSFULL")
    elif r.text == 'INVALID':
        print("FAILURE")
    else:
        print("NOTHING HAPPENED?")
    return ""



Here is my error message:
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://ipnpb.paypal.com/cgi-bin/webscr....


Can someone help me figure out what I am not understanding? maybe the link has changed?
Login to Me Too
2 REPLIES 2

Gusanito2013
Contributor
Contributor

Hi - did you get a solution for this?  Having exactly the same issue on the other endpoint

Login to Me Too

Kavyar
Moderator
Moderator

Good day @foreandr 

 

Thank you for posting to the PayPal community.

 

To address the issue you are facing, I would like to provide you with a detailed guide. Please refer to the link below:

 

https://www.paypal.com/us/cshelp/article/how-do-i-troubleshoot-instant-payment-notification-ipn-ts20...

 

Also, I would suggest trying it now by clearing browser cache and cookies.

 

If your still facing issues, please create an MTS ticket via - https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.