Page 1 of 1

Duplicate API Cancellation Notification

PostPosted: May 19th, 2011, 1:00 am
by toddz88
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:
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?

Re: Duplicate API Cancellation Notification

PostPosted: May 23rd, 2011, 2:43 am
by Jason Caldwell
Thanks for reporting this.
Yea, PayPal is known to do that every once in awhile.

In your script that handles your custom routine, I would take the %%subscr_id%% value and write a temporary file to disk. On the second Notification, check for the existence of that temporary file. If it exists, don't process it again.