• Resolved mikeknappe

    (@mikeknappe)


    Hi all,

    the IPN call from PayPal isn’t working for me.

    I’ve turned on the IPN in PayPal and inserted the following URL for IPN:
    https://my-domain.de/?rest_route=/paypalipn/v1/cf7pp_production

    In the IPN history of PayPal is all fine. PayPal says to all created IPNs:
    HTTP-Returncode: 200
    It was the original IPN, so no retries.
    IPN-Type: Transaction fullfilled

    ————————————

    What I’ve done so far:

    I tried the main URI in PayPal as IPN URL: No success.

    I also tried not to use the success URL of the plugin (PayPal Return URL), which didn’t lead to any changes.

    I’ve checked, if the register hook is called fpr the REST calls: Yes.

    I switched the rest method from POST to GET, to see, if the route was registered properly. And TADA, now the cf7pp_paypal_ipn_handler function is called, when I call the IPN URL directly.

    I tried the GET method for PayPal too, to see, if they are using GET instead of POST, but nope. There were no dummy file written, so they are using POST I guess.

    Any other ideas, why this isn’t working for me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mikeknappe

    (@mikeknappe)

    I discovered today the IPN simulator in the PayPal Dashboard.

    I tried several types:
    Cart checkout
    Web Accept
    eCheck – Complete

    All with the default parameters, to see, if the hook registration works and will be called.

    The behaviour:
    eCheck – Complete: Hook registration and hook call:
    IPN was sent and the handshake was verified.
    Cart checkout: No hook registration and no call, but:
    IPN was sent and the handshake was verified.
    Web Accept: Hook registration and hook call:
    IPN was sent and the handshake was verified.

    A simple Node.js script calling the IPN URL with some data works, to register the hook and call it:

    const https = require('https')
    
    const data = JSON.stringify({
      todo: 'Buy the milk'
    })
    
    const options = {
      hostname: 'my-domain.de',
      port: 443,
      path: '/?rest_route=/paypalipn/v1/cf7pp_production',
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Content-Length': data.length
      }
    }
    
    const req = https.request(options, res => {
      console.log(<code>statusCode: ${res.statusCode}</code>)
    
      res.on('data', d => {
        process.stdout.write(d)
      })
    })
    
    req.on('error', error => {
      console.error(error)
    })
    
    req.write(data)
    req.end()

    Why does the simulator work for Cart checkout / eCheck and even a POST request script, but not for a real transaction with PayPal?

    Thread Starter mikeknappe

    (@mikeknappe)

    I mean, there is at least a call from PayPal, because after the transaction, the dummy file for registering the hook got written.

    I finally tried to fetch the HTTP content within the cf7pp_paypal_ipn_listener like in the cf7pp_paypal_ipn_handler.

    The simulator of PayPal has all content within it’s call during cf7pp_paypal_ipn_listener and cf7pp_paypal_ipn_handler. So I guess, there is only one HTTP Post of PayPal after the transaction like written in the docs:
    https://developer.paypal.com/docs/api-basics/notifications/ipn/IPNIntro/#ipn-protocol-and-architecture

    So what does that mean in the end? Currently my guess is the following: either the query towards PayPal is missing something, so that the response is empty or PayPal is sending nothing – whereas the IPN history says something else (see above). So what the heck is wrong here?

    Thread Starter mikeknappe

    (@mikeknappe)

    It was a security setting in the interface of my webhoster, which prevented the IPNs.
    DANG!
    See: https://www.webdecker.de/artikel/items/strato-paypal-ipn-http-error-503.html
    So, if you have the same behaviour search in Google for: PayPal IPN 503
    Maybe your hoster has a security switch, too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘IPN from PayPal doesn’t work’ is closed to new replies.