latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Members not degrading after failed

Home Forums Community Forum Members not degrading after failed

This topic contains 6 replies, has 2 voices. Last updated by  Jason (Lead Developer) 4 years, 10 months ago.

Topic Author Topic
Posted: Wednesday Feb 8th, 2012 at 12:19 pm #4477

Hello,

I’m reposting this thread from old forums, since it appears that the content was not moved over.

I will just put in a quick summary:

Here are some logs from s2member-logs/paypal-ipn.log. I removed some of the fields which looked too sensivite or irrelevant:

'txn_type' => 'subscr_failed',
'subscr_id' => ***,
'time_created' => '14:25:06 Oct 06, 2010 PDT',
's2member_log' =>
array (
0 => 'IPN received on: Thu Oct 6, 2011 2:57:33 pm UTC',
3 => 's2Member `txn_type` identified as ( `subscr_failed|recurring_payment_failed|recurring_payment_skipped` ).',
4 => 'This `txn_type` does not require any action on the part of s2Member.',
5 => 's2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.',
6 => 'When multiple consecutive payments fail, a special IPN response will be triggered.',
),

'txn_type' => 'subscr_failed',
'subscr_id' => *** (matching the previous one),
's2member_log' =>
array (
0 => 'IPN received on: Tue Oct 11, 2011 2:50:12 pm UTC',
3 => 's2Member `txn_type` identified as ( `subscr_failed|recurring_payment_failed|recurring_payment_skipped` ).',
4 => 'This `txn_type` does not require any action on the part of s2Member.',
),

'txn_type' => 'recurring_payment_suspended_due_to_max_failed_payment',
'recurring_payment_id' => *** (matching the subscr_id above),
's2member_log' =>
array (
0 => 'IPN received on: Sun Oct 16, 2011 3:24:46 pm UTC',
2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
3 => 'Ignoring this IPN request. The `txn_type/status` does NOT require any action on the part of s2Member.',
),

We followed the latest upgrades, Jason was trying to help us, but it was no not enough. Lots of our users were created with old version of the plugin.

In the end, Jason decided, that we need extra logging, so he sent us some tweaked code. Thanks!

Here are the logs.

array (
  'payment_cycle' => 'Yearly',
  'txn_type' => 'recurring_payment_suspended_due_to_max_failed_payment',
  'last_name' => '...',
  'next_payment_date' => 'N/A',
  'residence_country' => 'US',
  'initial_payment_amount' => '0.00',
  'currency_code' => 'USD',
  'time_created' => '10:15:01 Jan 21, 2011 PST',
  'verify_sign' => 'A44EOaImnI.MwRNIZ36PF74Qu.zLAxe3E2dBM4wdijzy7Y7NjfKQiejA',
  'period_type' => 'Regular',
  'payer_status' => 'unverified',
  'tax' => '0.00',
  'payer_email' => '...@yahoo.com',
  'first_name' => 'Melony',
  'receiver_email' => 'info@....com',
  'payer_id' => 'NDXS...',
  'product_type' => '1',
  'shipping' => '0.00',
  'amount_per_cycle' => '30.00',
  'profile_status' => 'Suspended',
  'custom' => 'www.....com',
  'charset' => 'windows-1252',
  'notify_version' => '3.4',
  'amount' => '30.00',
  'outstanding_balance' => '30.00',
  'recurring_payment_id' => 'I-NPR3...',
  'product_name' => 'Member',
  'ipn_track_id' => '5a7384005b39e',
  's2member_log' =>
  array (
    0 => 'IPN received on: Tue Jan 31, 2012 10:41:54 am UTC',
    1 => 's2Member POST vars verified through a POST back to PayPal®.',
    2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
  ),
  'subscr_gateway' => 'paypal',
  'subscr_id' => 'I-NPR3...',
  'period1' => '0 D',
  'period3' => '1 D',
  'item_number' => false,
)

So in the end, Jason said:

I can see here what the issue is. s2Member is stopping on a failure to locate the item_number associated with the original transaction.

I suspect this is because your customer originally purchased access to your site while you were running an older version of s2Member. Unfortunately, this particular type of IPN that PayPal sends to s2Member, does not include the rp_invoice_id, or the PROFILEREFERENCE. This forces s2Member to keep a copy of this data locally, so it can reference this vital information and process the EOT.

s2Member started keeping this information locally, starting with version 110927. So if this particular customer signed up originally under a release prior, this could be the result. Unfortunately, there’s not much we can do about this now. PayPal changed the rules on us a bit, and we had to adapt accordingly. Members that signed up in earlier versions of s2Member may fail to expire in certain circumstances. Yours being one of these. This issue affected certain types of transactions where the storage of IPN Signup Vars was required by s2Member in order to fulfill its obligation later on, in being able to properly terminate access upon receipt of this IPN from PayPal. Newer versions of s2Member resolve this issue.

If you have several members this is affecting, my suggestion would be a manual EOT Time through your Dashboard. In your Dashboard you can set the EOT Time for certain customers, and s2Member will be perfectly capable of processing EOTs at the times you set, regardless of this issue. Of course, for any customer that originally paid you under a release of s2Member v110927+, you won’t need to do this.

I’m having issues formating the text as I would like to.

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Wednesday Feb 8th, 2012 at 12:25 pm #4479

Hello Jason,

now my actual reply.

If we add EOT, will it be reset once the members pay their yearly subscription? I guess it will, since you say s2Member handles that properly.

I’m thinking of a script to add this EOT time. It would take user registration time and add 365 + few more days to it (to allow processing of 3 PayPal retires of the payment ). It would have to do it on a yearly cycle basis, since some of the users might be registered back in 2009 and still active and paying their subscription.

Do you have such script somewhere? It would help if you could provide some code snippet, otherwise I’ll have to do it. I think we have around 1,700 users like that.

Thanks,
Martin

Posted: Thursday Feb 9th, 2012 at 2:24 pm #4658
Staff Member

Post received. Thank you for bringing this over for us. My apologies.
~ Reviewing this now. One moment please.

Posted: Thursday Feb 9th, 2012 at 2:44 pm #4660
Staff Member

We actually have a patch coming in a maintenance release this weekend, which deals with this issue. If you would like to install it yourself, you can download the attached file. Unzip and upload, allowing this file to override your existing copy of: /s2member/includes/classes/paypal-notify-in-subscr-or-rp-eots-w-level.inc.php

Patch file download (click here to download)

This allows s2Member to succeed in cases where no item_number can be defined. Please report any issues, we’ll appreciate any feedback you can provide.

Posted: Thursday Feb 9th, 2012 at 3:05 pm #4663
Staff Member

To answer your question…

A script to set the EOT Time will force s2Member to EOT each of those Users/Members at a specific date/time in the future. Future payments will NOT override this, no. Once you set an EOT manually, the only things that may override that value are as follows:

1. A new purchase is processed (not a payment, a new purchase, of something new).
2. A chargeback or refund is processed, and you have s2Member configured to force an immediate EOT on a chargeback or refund, under: s2Member -> PayPal Options -> EOT Behavior.

In all other cases, s2Member will respect whatever manual EOT Time you’ve configured for a customer. This is one of the primary purposes of this feature, is to put control into the site owner’s hands when it’s required for one reason or another.

A script. A utility script to force EOT Times for all Users/Members might look something like this.

<?php
$eot_time = strotime("2012-12-31");
foreach(get_users("role=s2member_level1") as $user)
	{
		update_user_meta($user->ID, "s2member_auto_eot_time", $eot_time);
	}
?>

You could tune this in further perhaps, with the documentation here on the get_users() function for WordPress®. Please see: http://codex.wordpress.org/Function_Reference/get_users

* I don’t think you’ll need this however, if you apply the patch file I submitted previously.

Posted: Tuesday Feb 21st, 2012 at 8:55 am #5853

Hello Jason,

we upgraded to the latest version and so no issues so far:

PHP v5.3.8 :: WordPress® v3.3.1 :: s2Member® v120213
Memory 25.23 MB :: Real Memory 25.50 MB :: Peak Memory 25.28 MB :: Real Peak Memory 25.50 MB
www.....com/wordpress/?s2member_paypal_notify=1
User-Agent: 
array (
  'payment_cycle' =&gt; 'Yearly',
  'txn_type' =&gt; 'recurring_payment_suspended_due_to_max_failed_payment',
  'last_name' =&gt; 'm......',
  'next_payment_date' =&gt; 'N/A',
  'residence_country' =&gt; 'FR',
  'initial_payment_amount' =&gt; '0.00',
  'currency_code' =&gt; 'USD',
  'time_created' =&gt; '22:26:41 Feb 10, 2011 PST',
  'verify_sign' =&gt; 'AtkaNjTO8sr7GfL6bvCsCeBLqkNzAoEfZoqR37zmNHjn1o-Zv9gT34yx',
  'period_type' =&gt; 'Regular',
  'payer_status' =&gt; 'unverified',
  'tax' =&gt; '0.00',
  'payer_email' =&gt; 'alessand....@....com',
  'first_name' =&gt; 'alessandro',
  'receiver_email' =&gt; 'info@....com',
  'payer_id' =&gt; 'C3QF....',
  'product_type' =&gt; '1',
  'shipping' =&gt; '0.00',
  'amount_per_cycle' =&gt; '.....00',
  'profile_status' =&gt; 'Suspended',
  'custom' =&gt; 'www......com',
  'charset' =&gt; 'windows-1252',
  'notify_version' =&gt; '3.4',
  'amount' =&gt; '....00',
  'outstanding_balance' =&gt; '30.00',
  'recurring_payment_id' =&gt; 'I-U7...',
  'product_name' =&gt; 'Member',
  'ipn_track_id' =&gt; '6b339be4f40a3',
  's2member_log' =&gt; 
  array (
    0 =&gt; 'IPN received on: Mon Feb 20, 2012 3:47:42 pm UTC',
    1 =&gt; 's2Member POST vars verified through a POST back to PayPal®.',
    2 =&gt; 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
    3 =&gt; '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` ).',
    4 =&gt; 'Sleeping for 5 seconds. Waiting for a possible ( `subscr_signup|subscr_modify|recurring_payment_profile_created` ).',
    5 =&gt; 'Awake. It\'s Mon Feb 20, 2012 3:47:47 pm UTC. 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` ).',
    6 =&gt; 'Member Level/Capabilities demoted to: Subscriber.',
  ),
  'subscr_gateway' =&gt; 'paypal',
  'subscr_id' =&gt; 'I-U7....',
  'period1' =&gt; '0 D',
  'period3' =&gt; '1 D',
  'item_number' =&gt; '1',
  'item_name' =&gt; 'Member',
  'ip' =&gt; '90.39.......',
)

I also haven’t noticed any recurring_payment_suspended_due_to_max_failed_payment where it would say that no action required, like it used to do before.

Thanks!
Martin

Posted: Thursday Feb 23rd, 2012 at 3:41 am #6087
Staff Member
Excellent! Thank you very much for the feedback on this.
~ Please keep us posted.
Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.