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™

EOT for Failed Payments?

s2Member Plugin. A Membership plugin for WordPress®.

EOT for Failed Payments?

Postby toddz88 » May 17th, 2011, 12:58 pm

When Paypal sends a "Failed Payments" IPN event (recurring_payment_suspended_due_to_max_failed_payment), what EOT value is set by s2member?

Is it basically immediate / instant / now (the time the ipn is received)?
Or is it calculated somehow (as Cancellations are)?
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: EOT for Failed Payments?

Postby Cristián Lávaque » May 17th, 2011, 1:27 pm

I believe that if he's in a trial, the EOT will be set at the end of it, and if he had paid access then the auto-EOT behavior applies immediately. But that's what I believe, I'll ask Jason to confirm this to be sure.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: EOT for Failed Payments?

Postby Jason Caldwell » May 18th, 2011, 6:58 pm

Thanks for the great question.
s2Member considers this an immediate EOT.
No EOT Time is set. Instead, s2Member demotes and/or deletes ( based on your configuration ), immediately in this scenario, txn_type=recurring_payment_suspended_due_to_max_failed_payment
~ 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

Re: EOT for Failed Payments?

Postby Cristián Lávaque » May 18th, 2011, 7:14 pm

Thanks for confirming it.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: EOT for Failed Payments?

Postby toddz88 » May 19th, 2011, 6:27 pm

So if Failed Payments do not actually set an EOT value, will it still trigger the s2m api "EOT/Deletion Notification", even if my s2m setting for Auto-EOT Behavior is "DEMOTE", rather than Delete? Should i read it as "EOT/Deletion/Demotion Notification" ?

Just want to clarify since the documentation under "EOT/Deletion Notification" does not explicitly mention Failed Payments, and does suggest that an EOT "is triggered" for these situations where we'd want to immediately deny the member access to the site:
An EOT is triggered immediately when you refund a Customer, when a Customer forces a chargeback to occur, or when a paid Subscription ends naturally ( i.e. expires ), and your Payment Gateway sends s2Member an EOT ( End Of Term ) response.
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: EOT for Failed Payments?

Postby toddz88 » May 20th, 2011, 2:12 am

I just noticed the list of possible values for the %%eot_del_type%% Replacement Code (shown in the documentation under API / Notifications > EOT/Deletion Notification):
user-removal-deletion ( i.e. manual removal/deletion )
auto-eot-cancellation-expiration-demotion
auto-eot-cancellation-expiration-deletion
ipn-cancellation-expiration-demotion
ipn-cancellation-expiration-deletion
ipn-refund-reversal-demotion
ipn-refund-reversal-deletion


But.. i'm still not clear which is used for Failed Payments (the IPN event "recurring_payment_suspended_due_to_max_failed_payment").
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: EOT for Failed Payments?

Postby toddz88 » May 20th, 2011, 6:49 pm

Trying to figure this out.. looking at s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in-inc.php, found "recurring_payment_suspended_due_to_max_failed_payment" mentioned only twice:

line 1268:
Code: Select all
(preg_match ("/^(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment)$/i",$paypal["txn_type"]) && ($recurring = 1))/**/

line 1294:
Code: Select all
$paypal["s2member_log"][] = "s2Member txn_type identified as (subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment) - or - recurring_payment_profile_cancel w/ initial_payment_status (failed).";

neither explicity map that PP IPN event to an s2m %%eot_del_type%%. So I'm guessing it's set to the "no/else" here..
line 1314:
Code: Select all
$eot_del_type = ($is_refund_or_reversal) ? "ipn-refund-reversal-demotion" : "ipn-cancellation-expiration-demotion";


So I am hoping for confirmation that:
a Max Failed Payments IPN triggers an s2m api "EOT/Deletion" Notification with %%eot_del_type%%="ipn-cancellation-expiration-demotion" ?

My goal in all this is to be able to alert the site owner (using s2m api notifs) when a member has been Suspended (in Paypal) and Demoted (in our site) due explicitly to MaxFailedPayments. This is IMPORTANT because this is probably a member who did NOT INTEND to lose access to the site, as opposed to someone who Cancelled (or did a Refund, Reversal, or Chargeback).

Thanks!
Todd
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: EOT for Failed Payments?

Postby Jason Caldwell » May 23rd, 2011, 3:38 am

Gotchya. I see what you're trying to accomplish now.

Yes, for txn_type=recurring_payment_suspended_due_to_max_failed_payment
%%eot_del_type%% = ipn-cancellation-expiration-demotion
Or, if you've configured s2Member to delete, it will be:
ipn-cancellation-expiration-deletion

No, we don't currently have a separate "type" string for this event, but I can certainly now why you want one. I'll see what we can do about that. Until then, you could do something like this.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_action
("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", "my_custom_function");
function my_custom_function($vars = array())
    {
        if($vars["paypal"]["txn_type"] === "recurring_payment_suspended_due_to_max_failed_payment")
            $vars["__refs"]["eot_del_type"] = "ipn-cancellation-failed-payments-demotion";
    }
?>

Now you will get this "type" string:
ipn-cancellation-failed-payments-demotion
~ 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] and 2 guests

cron