Validate that IPN call is from PayPal?

前端 未结 6 2000
南方客
南方客 2020-12-09 21:58

How can I validate that a PayPal IPN POST request to my specified notifyURL is indeed coming from PayPal?

I don\'t mean comparing the data to what I sent earlier, bu

6条回答
  •  猫巷女王i
    2020-12-09 22:21

    This is what I use:

    if (preg_match('~^(?:.+[.])?paypal[.]com$~', gethostbyaddr($_SERVER['REMOTE_ADDR'])) > 0)
    {
        // came from paypal.com (unless your server got r00ted)
    }
    

提交回复
热议问题