Page 1 of 1

Registration with pro-form doesn't show proper level

PostPosted: July 18th, 2011, 10:23 pm
by wiseeyesmedia
I am also having the same issue after upgrading to s2Member Pro v110710 where new user registers using PayPal Pro forms but does not show proper level. This is only after upgrading to v110710 - my signup page has not changed in months. All previous versions of s2Member seemed to work fine.

This has occurred with multiple new users in the past week without major configuration changes on my end, so my initial thought is some change in s2Member is causing the issue. Note the use of a custom success page. This page has been in place for months and has been working fine, but may be atypical for most configurations.

PayPal appears to respond properly via IPN, but I'm not knowledgeable of the details of their API. The issue seems to be that s2Member cannot associate the IPN with the proper account, according to the error log. However, the subscr_id and txn_id from the first log entry does match the recurring_payment_id of the second entry, so I don't know why s2Member cannot locate that account.

All private data has been redacted or altered.

Shortcode
Code: Select all
[s2Member-Pro-PayPal-Form level="2" ccaps="" desc="Silver Membership - $9.95 each month" ps="paypal" cc="USD" ns="1" custom="[MYDOMAIN].com" ta="0" tp="0" tt="D" ra="9.95" rp="1" rt="M" rr="1" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" success="/order-success/?subscr_id=%%subscr_id%%" /]


PayPal API Log
Code: Select all
WordPress® v3.1.3 :: s2Member® v110710 :: s2Member® Pro v110710
[MY DOMAIN]/sign-up/silver-membership/?s2-ssl=yes
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; .NET4.0C)
-------- Input vars: ( Mon Jul 18, 2011 6:30:49 am UTC ) --------
array (
  'METHOD' => 'CreateRecurringPaymentsProfile',
  'EMAIL' => 'customer@email.com',
  'FIRSTNAME' => 'My',
  'LASTNAME' => 'Customer',
  'SUBSCRIBERNAME' => '[My Customer]',
  'DESC' => 'Silver Membership - $9.95 each month',
  'PROFILEREFERENCE' => '1313605849:0 D:1 M~[MY DOMAIN]~2',
  'INITAMT' => '9.95',
  'FAILEDINITAMTACTION' => 'CancelOnFailure',
  'CURRENCYCODE' => 'USD',
  'AMT' => '9.95',
  'TAXAMT' => '0.00',
  'MAXFAILEDPAYMENTS' => '2',
  'AUTOBILLOUTAMT' => 'AddToNextBilling',
  'PROFILESTARTDATE' => '2011-08-17T00:00:00Z',
  'BILLINGPERIOD' => 'Month',
  'TOTALBILLINGCYCLES' => '0',
  'BILLINGFREQUENCY' => '1',
  'CREDITCARDTYPE' => 'Visa',
  'ACCT' => '************7892',
  'EXPDATE' => 'XXXXXX',
  'CVV2' => 'XXX',
  'STREET' => 'XXXX',
  'CITY' => 'Somewhere',
  'STATE' => 'LA',
  'COUNTRYCODE' => 'US',
  'ZIP' => '55555',
  'VERSION' => '71.0',
  'USER' => 'customerservice_api1.[MYDOMAIN].com',
  'PWD' => '[REDACTED]',
  'SIGNATURE' => 'AWEfTXRcXxwK8lhsDfp8zxRBEvwbAW-eeJiXB-ha0K2rXkMQcXQDYo.3',
)
-------- Output string/vars: ( Mon Jul 18, 2011 6:30:54 am UTC ) --------
PROFILEID=I%2dR9YXV4D45GF6&PROFILESTATUS=PendingProfile&TRANSACTIONID=32G47995AS627720N&TIMESTAMP=2011%2d07%2d18T06%3a30%3a54Z&CORRELATIONID=54c6864130431&ACK=Success&VERSION=71%2e0&BUILD=1982348
array (
  'PROFILEID' => 'I-R9YXV4D45GF6',
  'PROFILESTATUS' => 'PendingProfile',
  'TRANSACTIONID' => '32G47995AS627720N',
  'TIMESTAMP' => '2011-07-18T06:30:54Z',
  'CORRELATIONID' => '54c6864130431',
  'ACK' => 'Success',
  'VERSION' => '71.0',
  'BUILD' => '1982348',
)



PayPal IPN Log
Code: Select all
WordPress® v3.1.3 :: s2Member® v110710 :: s2Member® Pro v110710
[MY DOMAIN]/?s2member_paypal_notify=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=pro-emails,subscr-signup-as-subscr-payment&s2member_paypal_proxy_verification=8bf74f71d6adeed0d5a4b802d0694a7e&s2member_paypal_proxy_return_url=%2Forder-success%2F%3Fsubscr_id%3D%25%25subscr_id%25%25
User-Agent: WordPress/3.1.3; http://[MY DOMAIN]
array (
  'txn_type' => 'subscr_signup',
  'subscr_id' => 'I-R9YXV4D45GF6',
  'custom' => '[MY DOMAIN]',
  'txn_id' => 'I-R9YXV4D45GF6',
  'period1' => '0 D',
  'period3' => '1 M',
  'mc_amount1' => '0.00',
  'mc_amount3' => '9.95',
  'mc_gross' => '9.95',
  'mc_currency' => 'USD',
  'tax' => '0.00',
  'recurring' => '9.95',
  'payer_email' => 'customer@email.com',
  'first_name' => 'My',
  'last_name' => 'Customer',
  'option_name1' => 'Originating Domain',
  'option_selection1' => '[MY DOMAIN]',
  'option_name2' => 'Customer IP Address',
  'option_selection2' => 'XXXXXX',
  'item_name' => 'Silver Membership - $9.95 each month',
  'item_number' => '2',
  'proxy_verified' => 'paypal',
  's2member_log' =>
  array (
    0 => 'IPN received on: Mon Jul 18, 2011 6:31:03 am UTC',
    1 => 's2Member POST vars verified with a Proxy Key',
    2 => 's2Member originating domain ( _SERVER[HTTP_HOST] ) validated.',
    3 => 's2Member txn_type identified as (web_accept|subscr_signup).',
    4 => 's2Member txn_type identified as (web_accept|subscr_signup) w/o update vars.',
    5 => 'Signup Confirmation Email sent to: "My Customer" <customer@email.com>;  "MY EMAIL" <support@MYDOMAIN.com>.',
    6 => 'Subscr. Return ( modification=0 ), a Proxy Return URL is ready.',
    7 => 'User exists. Handling `payment` for Subscription via (subscr-signup-as-subscr-payment).',
    8 => 'Storing IPN signup vars now. These are associated with a User\'s account record; for future reference.',
  ),
  'subscr_gateway' => 'paypal',
  'eotper' => NULL,
  'ccaps' => NULL,
  'level' => '2',
  'ip' => 'XXXXXXXX,
  'initial_term' => '0 D',
  'initial' => '9.95',
  'regular' => '9.95',
  'regular_term' => '1 M',
  's2member_paypal_proxy_return_url' => '/order-success/?subscr_id=I-R9YXV4D45GF6',
  's2member_paypal_proxy' => 'paypal',
  's2member_paypal_proxy_use' => 'pro-emails,subscr-signup-as-subscr-payment',
  's2member_paypal_proxy_verification' => '8bf74f71d6adeed0d5a4b802d0694a7e',
)

WordPress® v3.1.3 :: s2Member® v110710 :: s2Member® Pro v110710
[MY DOMAIN]/?s2member_paypal_notify=1
User-Agent:
array (
  'payment_cycle' => 'Monthly',
  'txn_type' => 'recurring_payment_profile_created',
  'last_name' => 'XXXXXX',
  'initial_payment_status' => 'Completed',
  'next_payment_date' => '03:00:00 Aug 17, 2011 PDT',
  'residence_country' => 'US',
  'initial_payment_amount' => '9.95',
  'rp_invoice_id' => '1313605849:0 D:1 M~XXXXXXXX~2',
  'currency_code' => 'USD',
  'time_created' => '23:30:50 Jul 17, 2011 PDT',
  'verify_sign' => 'A-pcCUYuDoJPnuGGfK3zNCJ2OPldAgBy6MMTSHpuNT1rG2noxqI0m6Df',
  'period_type' => 'Regular',
  'payer_status' => 'unverified',
  'tax' => '0.00',
  'payer_email' => 'XXXXXXXX',
  'first_name' => 'XXXX',
  'receiver_email' => 'XXXXXX',
  'payer_id' => 'WUCKN96BP7GSA',
  'product_type' => '1',
  'initial_payment_txn_id' => 'XXXXXXX',
  'shipping' => '0.00',
  'amount_per_cycle' => '9.95',
  'profile_status' => 'Active',
  'charset' => 'windows-1252',
  'notify_version' => '3.1',
  'amount' => '9.95',
  'outstanding_balance' => '0.00',
  'recurring_payment_id' => 'I-R9YXV4D45GF6',
  'product_name' => 'Silver Membership - $9.95 each month',
  'ipn_track_id' => 'geOuBff2YWY5DCWi2CqSFg',
  's2member_log' =>
  array (
    0 => 'IPN received on: Mon Jul 18, 2011 6:31:11 am UTC',
    1 => 's2Member POST vars verified through a POST back to PayPal®.',
    2 => 'Transaction type ( ^recurring_? ), but there is no match to an existing account; so verification of _SERVER[HTTP_HOST] was not possible.',
  ),
  'subscr_gateway' => 'paypal',
  'custom' => false,
)

Re: Registration with pro-form doesn't show proper level

PostPosted: July 19th, 2011, 11:06 pm
by Cristián Lávaque
I'll ask Jason about this, I'm not sure what the problem is.

I did notice that you have an older version of WordPress (3.1.3) instead of the latest (3.2.1). It'd be good to update your installation, this has solved problems for other users. :)

Re: Registration with pro-form doesn't show proper level

PostPosted: July 21st, 2011, 5:24 pm
by Jason Caldwell
Thanks for bringing this to my attention.

Hmm. I've been unable to reproduce this on our end so far. From your log entries, it appears that the "custom" value which holds your domain name is not being recorded properly on your installation.
Code: Select all
Transaction type ( ^recurring_? ), but there is no match to an existing account; so verification of _SERVER[HTTP_HOST] was not possible.

Does your installation of WordPress use any database caching? What other plugins are you running in concert with s2Member please?

As a test, try creating this directory and file:
/wp-content/mu-plugins/s2-diagnostic.php
Code: Select all
<?php
add_action 
("init", "s2_diagnostic");
function s2_diagnostic ()
    {
        if (!empty ($_GET["s2_diagnostic"]))
            {
                echo c_ws_plugin__s2member_utils_users::get_user_custom_with ("I-R9YXV4D45GF6");
                exit;
            }
    }
?>
Then load up your site like this:
Code: Select all
http://www.yoursite.com/?s2_diagnostic=yes
* please let me know what it says.

Re: Registration with pro-form doesn't show proper level

PostPosted: July 21st, 2011, 7:11 pm
by wiseeyesmedia
Jason,

I followed the steps you provided. The s2_diagnostic page returns my domain in the form [mysite].com. There is no prepended "www" or anything like that.

I do use W3 Total Cache on my site with database caching enabled, which in turn uses the APC plugin for PHP. Do you think the query is hitting a cached version of the user table before the user is actually inserted via the registration?

It's unusual because it only started happening with the most recent version of s2Member.

I could disable DB caching, but it does improve performance on my site. Perhaps we should look into an option for bypassing caching for critical INSERT and SELECT queries.

Re: Registration with pro-form doesn't show proper level

PostPosted: July 22nd, 2011, 10:04 pm
by Jason Caldwell
Thanks for the follow-up.

OK. That's the response I was hoping for. It's valid ( i.e. what it should be ).

Yea, it's possible that your caching plugin is returning stale information. However, a good caching plugin should listen to option updates issued by core WordPress routines, such as update_user_option(), which updates data in the database. That being said, I won't profess to be an expert on database caching. This might be something to ask the W3 developers about.

Did this log entry:
Code: Select all
'txn_type' => 'recurring_payment_profile_created'

Come after the one for:
Code: Select all
'txn_type' => 'subscr_signup'

If so, then yea, I would try disabling your DB cache, and see if that fixes it. Please let me know how this goes. If that's the problem, and there is something we can do to improve s2Member in this regard, I'd very much like to do so.

Re: Registration with pro-form doesn't show proper level

PostPosted: July 27th, 2011, 3:52 pm
by wiseeyesmedia
Jason,

The IPN log order (as you can see listed in full above) was as follows:

Code: Select all
'txn_type' => 'subscr_signup'
....
'txn_type' => 'recurring_payment_profile_created'


I have disabled W3 Total Cache's database cache option and it did seem to alleviate the issue. I'll keep monitoring the situation to see if that resolves the issue completely.

Looking at W3TC, they also provide the ability to cache using WordPress's object API, so it appears unnecessary to do both object caching and database caching. Right now database caching is disabled and object caching in enabled and I have not noticed any major issues.

Re: Registration with pro-form doesn't show proper level

PostPosted: August 1st, 2011, 12:42 am
by Jason Caldwell
Got it. Thanks for reporting back on this.
~ I'll run some tests as well.

In the mean time, I'm going to add this thread to our list of possible conflicts with the particular configuration you mentioned, just so anyone else having weird problems might find it.

Re: Registration with pro-form doesn't show proper level

PostPosted: August 20th, 2011, 4:51 pm
by Jason Caldwell
Update, this bug has been reported again here:
viewtopic.php?f=4&t=14599&p=32501#p32501