PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Duplicate API Cancellation Notification

s2Member Plugin. A Membership plugin for WordPress®.

Duplicate API Cancellation Notification

Postby toddz88 » 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:
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?
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Duplicate API Cancellation Notification

Postby Jason Caldwell » May 23rd, 2011, 2:43 am

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests

cron