关于Recurring payments与IPN通知的技术问题咨询
Hey there! Let's break down your two questions about PayPal Instant Payment Notifications (IPN) for recurring payments clearly:
1. Does the first IPN for recurring payments trigger alongside the initial payment?
Absolutely. When a user completes the initial payment for a recurring subscription, PayPal will immediately send an IPN notification tied directly to this first payment. You'll typically receive a subscr_payment type IPN that includes all details of the initial transaction—like the amount, payment status, subscription ID, and buyer info. Additionally, you might get a separate subscr_signup IPN (confirming the subscription was created) around the same time, but the key takeaway is: the IPN for the first payment triggers synchronously with the initial payment processing.
2. Does PayPal's notifyurl include a validation token (e.g., https://someurl.com/callback/[validation-token])?
Nope. PayPal will call the exact notifyurl you specify when setting up the payment/subscription—it won't automatically add any validation tokens to the URL path or query parameters. The correct way to validate an IPN's legitimacy is to take the entire payload you receive from PayPal, append the cmd=_notify-validate parameter to it, and send this data back to PayPal's IPN verification endpoint. You'll then get a response of either VERIFIED (legitimate) or INVALID (fraudulent/modified) to confirm the notification's authenticity.
内容的提问来源于stack exchange,提问作者Aleksandr Popov

