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.

About: Tim Parkin

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
s2member as author?

By:  Tim Parkin in: Community Forum

voices: 3
replies: 15

4 years, 5 months ago  Cristián Lávaque

Error 4020 on Paypal PDT

By:  Tim Parkin in: Community Forum

voices: 3
replies: 19

4 years, 5 months ago  Jason (Lead Developer)

Viewing 2 topics - 1 through 2 (of 2 total)

Topics I've Started

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
s2member as author?

By:  Tim Parkin in: Community Forum

voices: 3
replies: 15

4 years, 5 months ago  Cristián Lávaque

Error 4020 on Paypal PDT

By:  Tim Parkin in: Community Forum

voices: 3
replies: 19

4 years, 5 months ago  Jason (Lead Developer)

Viewing 2 topics - 1 through 2 (of 2 total)

My Latest Replies (From Various Topics)

Viewing 17 replies - 1 through 17 (of 17 total)
Author Replies
Author Replies
Posted: Wednesday Jul 25th, 2012 at 5:05 am #20179
Tim Parkin
Username: timparkin

Brilliant :-) I haven’t used these custom roles before and didn’t want to inadvertantly break s2member!

Posted: Wednesday Jul 25th, 2012 at 4:56 am #20176
Tim Parkin
Username: timparkin

no I need to keep the user as an author when they are demoted – i.e. the fact they are an author is completely separate from any subscription stuff..

Posted: Wednesday Jul 25th, 2012 at 4:53 am #20174
Tim Parkin
Username: timparkin

And what would happen when their subscription ran out? i.e. how would it know to demote to a role that was still had author role capability?

Posted: Wednesday Jul 25th, 2012 at 4:23 am #20170
Tim Parkin
Username: timparkin

The problem then is that everybody would have the author roles (if I use the existing s2member role) or I would have to manage a new role that wouldn’t be included in the promote/demote process.

It sounds like it’s not really possible if you want this to work without manually intervening in various steps. Has no-one else had an issue where they want to use different roles for subscribers before?

Posted: Wednesday Jul 25th, 2012 at 3:43 am #20166
Tim Parkin
Username: timparkin

Yes but what happens when their subscription changes?

Posted: Wednesday Jul 25th, 2012 at 2:54 am #20157
Tim Parkin
Username: timparkin

I don’t really care how I make them the author but at the moment I just want to change their role to ‘author’ (either before or after they submit the post via email or through wp-admin) but that would mean removing their subscription role.

Posted: Tuesday Jul 24th, 2012 at 8:16 am #20053
Tim Parkin
Username: timparkin

I’ll try to simplify… I want to list one of my subscribers as an author of a post… how do I do this?

Posted: Friday Jul 13th, 2012 at 6:17 am #19147
Tim Parkin
Username: timparkin

I’ve sent the details already but if you want ftp access you’ll need to send me a public key. For security sake, you can login in to my wordpress and paste the public key into a draft page.

All transactions are live..

I have the system working for new transactions now but I have to force people to register an account first and then go through subscription. I thought it was possible to pay for a subscription and then create an account but this is where the 4020 problem is happening.

Tim

Posted: Thursday Jul 12th, 2012 at 6:48 pm #19089
Tim Parkin
Username: timparkin

No mod_security on the server (I manage a dedicated).

I’ll take another look at the IPN and use a redirect for it.

Could you ask if that args packet looks right for a new subscription post vars call?

Posted: Thursday Jul 12th, 2012 at 6:21 pm #19085
Tim Parkin
Username: timparkin

Did I mention that I can’t change the ipn url for older transactions and hence can’t use the central ipn.

PDT is fine as the post vars are being verified properly for the normal IPN transactions.

I suppose I could add a url handler that redirected to the central IPN script.

Have you got any idea whether this looks like a correct packet for the PDT callback

post vars :-
array (
  'tx' => '58563307UC021584B',
  'cmd' => '_notify-synch',
  'at' => 'EM3E9cLMxGWoOQNSfjO5qszsXnU85W1OvFAKOqG7hxxxxxxxxxxd-V04',
)
args :-
array (
  'timeout' => 20,
)
url :-
'https://www.paypal.com/cgi-bin/webscr'

This is the ‘remote’ call that ends up with a 4020 return value. The PDT is fine and the tx is fine… can’t work out why it would fail?

Posted: Thursday Jul 12th, 2012 at 8:40 am #19033
Tim Parkin
Username: timparkin

the S2member stores the domain at the front of the custom field. For older IPN’s from Your Members, the custom field does not contain the domain at the start and hence the server host check fails.

Here is an array of txn_type, item_number, custom fields – firstly a current s2member one

'txn_type' => 'subscr_cancel',
'item_number' => '3',
'custom' => 'www.newdomain.co.uk',

and now an older one

'txn_type' => 'subscr_payment',
'item_number' => '314',
'custom' => '14_3_GBP_2049_858ba4765e53c712ef672a9570474b1d_D_subscriber_78.143.213.237_0',

or

'txn_type' => 'subscr_payment',
'item_number' => 'buy_subscription_7_2678',
'custom' => '14_3_GBP_1808_858ba4765e53c712ef672a9570474b1d_D_subscriber_90.218.6.193_0',
 

The central IPN script would require that I change the url on each transaction which I am unable to do. Instead I have rewritten the requests to point at the s2member url and forced a match on server host.

I am occasionally getting error messages now that read

0 => 'IPN received on: Thu Jul 12, 2012 10:42:32 am UTC',
1 => 's2Member POST vars verified through a POST back to PayPal®.',
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.',

alhtough some IPNs with the same txn_type and status are going through.

My concern now is the 4020 codes coming back from paypal when a new subscription is going through. The error suggests POST vars could not be verified but the IPN system is happy verifiying post vars with the same PDT.

I’m putting in some more logging and testing again but if you have any experience of new subs going to the ‘grey’ page with the ‘post vars could not be verified’ I would really appreciate some ideas..

Posted: Wednesday Jul 11th, 2012 at 6:15 pm #18962
Tim Parkin
Username: timparkin

please?

Posted: Wednesday Jul 11th, 2012 at 11:07 am #18928
Tim Parkin
Username: timparkin

Jason?

I’m still getting an error when people subscribe (post vars problem) and the error when IPN updates come through (non matching item numbers). As time goes by the amount of manual fixes I’m going to have to make is going up (and not being able to export the whole database for analysis isn’t helping – any ideas on that as well?)

  • This reply was modified 4 years, 6 months ago by  Tim Parkin.
Posted: Sunday Jul 8th, 2012 at 4:46 pm #18623
Tim Parkin
Username: timparkin

Hi Cristián,

My fix was just to skip the paypal[‘custom’] check so it forced a domain (server host) match. However, once this happened the IPN packets were being ignored – I think this is because some of the variables didn’t atch what was expected.

I’m thinking that item_numer, item_name and txn_type probably need to be hacked but I’d love to have some feedback before I go ahead and do that.

Tim

Posted: Sunday Jul 8th, 2012 at 8:28 am #18611
Tim Parkin
Username: timparkin

Yes I’ve gone through this already. What about the question in the ps i.e. item_number not matching current system expectations?

Posted: Sunday Jul 8th, 2012 at 6:48 am #18601
Tim Parkin
Username: timparkin

Since these posts I have also been debugging some older IPNs… It seems that paypal stores the IPN with the transaction and so some IPNs have been failing (although paypal has stored them as a 200 return code).

I’ve since added an apache redirect to get them into the right place but now I have been getting “unable to verify server host” because the old subscription transactions used a different value for the ‘custom’ field (e.g. 14_3_GBP_464_858ba4765e53c712ef672a9570474b1d_D_subscriber_86.31.173.xx_0).

How do I make s2member accept these IPNs? I don’t fancy hacking the ‘paypal-return-in.inc.php‘ code but I think I may have to end up hacking

if (!empty ($paypal["custom"]) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"]))

to force a successful match? Any other ideas?

p.s. I did hack this line just to check if there were any other issues. Then the server stated it was going to ignore this IPN. I’m presuming this is because the item_number and possibly other fields didn’t match. Does this mean I have to rewrite the packet completely to match a new subscriber profile? If so could you tell me which fields would need fixing?

  • This reply was modified 4 years, 6 months ago by  Tim Parkin.
Posted: Friday Jul 6th, 2012 at 7:43 am #18464
Tim Parkin
Username: timparkin

What does your IPN log say about the transactions? Could you quote the entry for one of the transactions with the problem? (x’ing out any private info, e.g. emails)

PHP v5.3.2-1ubuntu4.15 :: WordPress® v3.4.1 :: s2Member® v120622 :: s2Member® Pro v120622
Memory 32.71 MB :: Real Memory 33.00 MB :: Peak Memory 32.74 MB :: Real Peak Memory 33.00 MB
mydomain.com/?s2member_paypal_notify=1
User-Agent: 
array (
  'txn_type' => 'subscr_signup',
  'subscr_id' => 'I-xxxx',
  'last_name' => 'Elsen',
  'option_selection1' => 'mydomain.com',
  'option_selection2' => '82.132.xxx.xxx',
  'residence_country' => 'GB',
  'mc_currency' => 'GBP',
  'item_name' => 'Bi-weeky recurring subscription.',
  'business' => 'paypalemail@paypaldomain.com',
  'recurring' => '90.00',
  'verify_sign' => 'A17O5CpnB8Msm1oZA40qsYHojqAVAsfh6TryG1Wt4OXWJbUi5aiMxxxx',
  'payer_status' => 'unverified',
  'payer_email' => 'customer@gmail.com',
  'first_name' => 'Jerry',
  'receiver_email' => 'paypalemail@paypaldomain.com',
  'payer_id' => 'W9TSBC44Gxxxx',
  'option_name1' => 'Originating Domain',
  'invoice' => '4ff55e1d9ab4e~82.132.xxx.xxx',
  'option_name2' => 'Customer IP Address',
  'reattempt' => '1',
  'item_number' => '1',
  'subscr_date' => '02:29:18 Jul 05, 2012 PDT',
  'custom' => 'mydomain.com',
  'charset' => 'windows-1252',
  'notify_version' => '3.4',
  'period3' => '2 W',
  'mc_amount3' => '90.00',
  'ipn_track_id' => '4b36a084exxxx',
  's2member_log' => 
  array (
    0 => 'IPN received on: Thu Jul 5, 2012 9:29:38 am UTC',
    1 => 's2Member POST vars verified through a POST back to PayPal®.',
    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: "Jerry Reed" <customer@gmail.com>.',
    6 => 'Storing IPN signup vars into a Transient Queue. These will be processed on registration.',
  ),
  'subscr_gateway' => 'paypal',
  'eotper' => NULL,
  'ccaps' => NULL,
  'level' => '1',
  'ip' => '82.132.xxx.xxx',
  'period1' => '0 D',
  'mc_amount1' => '0.00',
  'initial_term' => '0 D',
  'initial' => '90.00',
  'regular' => '90.00',
  'regular_term' => '2 W',
)

the paypal-rtn looks like this

PHP v5.3.2-1ubuntu4.15 :: WordPress® v3.4.1 :: s2Member® v120622 :: s2Member® Pro v120622
Memory 28.91 MB :: Real Memory 29.25 MB :: Peak Memory 29.01 MB :: Real Peak Memory 29.25 MB
mydomain.com/?s2member_paypal_return=1&s2member_paypal_return_tra=fnIyOlMwWjVNS01kekVUeE9pN2pydTYzVVhKeTJkcTJndUZ2OjQ2MzY4ZmNlNDg5OGNiNTQ3ZjE4ZTkwZDBlMjU2Z
jNkfCzjX64cgzLQgxchJBCeSDXjQiGGJE3qgZoKp7fZ6W6RLPDORGAQJfhxSHeLfeg_u4KWc_ZT1vFmH_g9QfDk1VnwtiJiI-tmtmAS_T_5Nekh1ETsK-7LMJWexH5iB9jfHCiCYOVACtpisxD67KYRf1A1bNnkTtdRt
83mDvj9cbjjq47J2BeGPKmW16ve5idjxF7R7uKajqC4z5lhFJugGt2y7nAPnM_8rqWNv1D_8fvny6_0y76hqTlbCP626fm6MqUUAqhQsiD3jRQPsXt5h5lsQGOnYNdgXh8seAtOmFVFpbrbO6XOUCZX6sO5b7n4T8woC
Q4hDkLDClfWONJ-ZN9l4Sm71Qs1WYvWADMvHqHHO1V3RSsVEjMuVKcRKz2WmA&tx=0JU85470SY786432Y&st=Completed&amt=3.00&cc=GBP&cm=mydomain.com&item_number=&sig=uEnlhdPojC
pZ5KwP9KEXMH57lv%2foRXjs67znlZ7YB6zGr6JJ8GJ6Vccamds0S8K6PGOfDc%2bAiR7gahX6cJHIRzhHOY0S2ho%2fxW6lvt1I08HFqWdDgJDr4Q07nCSgZf9LTW2wFrjzZB%2f6qlbGrZieyNLiWQYqjTtFKvsfO6
nxxxxx%3d
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0.1
array (
  's2member_log' => 
  array (
    0 => 'Unable to verify $_POST vars. This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility.',
    1 => 'If you\'re absolutely SURE that your configuration is valid, you may want to run some tests on your server, just to be sure $_POST variables are populated
, and that your server is able to connect/communicate with your Payment Gateway over an HTTPS connection.',
    2 => 's2Member uses the `WP_Http` class for remote connections; which will try to use `cURL` first, and then fall back on the `FOPEN` method when `cURL` is not 
available. On a Windows® server, you may have to disable your `cURL` extension; and instead, set `allow_url_fopen = yes` in your php.ini file. The `cURL` extension 
(usually) does NOT support SSL connections on a Windows® server.',
    3 => 'Please see this thread: `http://www.s2member.com/forums/topic/ideal-server-configuration-for-s2member/` for details regarding the ideal server configurati
on for s2Member.',
    4 => 'array (
  \'s2member_paypal_return\' => \'1\',
  \'s2member_paypal_return_tra\' => \'fnIyOlMwWjVNS01kekVUeE9pN2pydTYzVVhKeTJkcTJndUZ2OjQ2MzY4ZmNlNDg5OGNiNTQ3ZjE4ZTkwZDBlMjU2ZjNkfCzjX64cgzLQgxchJBCeSDXjQiGGJE3qgZ
oKp7fZ6W6RLPDORGAQJfhxSHeLfeg_u4KWc_ZT1vFmH_g9QfDk1VnwtiJiI-tmtmAS_T_5Nekh1ETsK-7LMJWexH5iB9jfHCiCYOVACtpisxD67KYRf1A1bNnkTtdRt83mDvj9cbjjq47J2BeGPKmW16ve5idjxF7R7u
KajqC4z5lhFJugGt2y7nAPnM_8rqWNv1D_8fvny6_0y76hqTlbCP626fm6MqUUAqhQsiD3jRQPsXt5h5lsQGOnYNdgXh8seAtOmFVFpbrbO6XOUCZX6sO5b7n4T8woCQ4hDkLDClfWONJ-ZN9l4Sm71Qs1WYvWADMvHq
HHO1V3RSsVEjMuVKcRKz2xxx\',
  \'tx\' => \'0JU85470SY786xxxx\',
  \'st\' => \'Completed\',
  \'amt\' => \'90.00\',
  \'cc\' => \'GBP\',
  \'cm\' => \'mydomain.com\',
  \'item_number\' => \'\',
  \'sig\' => \'uEnlhdPojCpZ5KwP9KEXMH57lv/oRXjs67znlZ7YB6zGr6JJ8GJ6Vccamds0S8K6PGOfDc+AiR7gahX6cJHIRzhHOY0S2ho/xW6lvt1I08HFqWdDgJDr4Q07nCSgZf9LTW2wFrjzZB/6qlbGrZiey
NLiWQYqjTtFKvsfO6nxxxx=\',
)',
    5 => 'Redirecting Customer to the Home Page, due to an error that occurred.',
  ),
  's2member_paypal_return_tra' => 'fnIyOlMwWjVNS01kekVUeE9pN2pydTYzVVhKeTJkcTJndUZ2OjQ2MzY4ZmNlNDg5OGNiNTQ3ZjE4ZTkwZDBlMjU2ZjNkfCzjX64cgzLQgxchJBCeSDXjQiGGJE3qgZoKp
7fZ6W6RLPDORGAQJfhxSHeLfeg_u4KWc_ZT1vFmH_g9QfDk1VnwtiJiI-tmtmAS_T_5Nekh1ETsK-7LMJWexH5iB9jfHCiCYOVACtpisxD67KYRf1A1bNnkTtdRt83mDvj9cbjjq47J2BeGPKmW16ve5idjxF7R7uKaj
qC4z5lhFJugGt2y7nAPnM_8rqWNv1D_8fvny6_0y76hqTlbCP626fm6MqUUAqhQsiD3jRQPsXt5h5lsQGOnYNdgXh8seAtOmFVFpbrbO6XOUCZX6sO5b7n4T8woCQ4hDkLDClfWONJ-ZN9l4Sm71Qs1WYvWADMvHqHHO
1V3RSsVEjMuVKcRKz2xxxx',
)

The server check tools runs with all green lights..

Viewing 17 replies - 1 through 17 (of 17 total)

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.