Duplicate API Cancellation Notification
Posted: May 19th, 2011, 1:00 am
When a member CANCELS, Paypal seems to send 2 different IPNs, about 20 seconds apart, which I see in my log (paypal-ipn.log) as:
- subscr_cancel
- recurring_payment_profile_cancel
They BOTH trigger the s2m API Cancellations Notification, for which I have some php that sends an email to the site owner, who therefore gets two (nearly) identical emails when a member cancels.
The IPN log shows that s2m is aware of the duplication:
How can I PREVENT one of the API Notifications from being processed, or somehow distinguish between the two different IPNs, so that my routine runs only once?
- subscr_cancel
- recurring_payment_profile_cancel
They BOTH trigger the s2m API Cancellations Notification, for which I have some php that sends an email to the site owner, who therefore gets two (nearly) identical emails when a member cancels.
The IPN log shows that s2m is aware of the duplication:
- Code: Select all
4 => 'Ignoring Cancellation. An Auto-EOT Time is already set for this Member. An s2Member API Notification will still be processed however.',
5 => 'Cancellation Notification URLs have been processed.',
How can I PREVENT one of the API Notifications from being processed, or somehow distinguish between the two different IPNs, so that my routine runs only once?