@clavaque I worked on this issue some more tonight and developed a workaround that is currently working for me, insert at line 105 of s2member/src/includes/classes/paypal-return-in.inc.php
:
sleep(3);
wp_redirect( home_url( preg_replace( '`(&do_not_cache=[0-9]{5}){2,}`', '&do_not_cache=' . rand(10000,99999), $_SERVER["REQUEST_URI"] . '&do_not_cache=' . rand(10000,99999) ) ) );
exit;
Not an ideal solution but seems to work after a few redirects, which are aren’t visible to anyone. You actually stay on PayPal’s “Please Wait…” screen until s2Member gets a good response from PayPal.
I would have posted the zipped PHP file but my account is too new to allow file uploads.
Anyways, there seems to be a timing issue with PayPal having the subscription finalized before s2Member requests subscription details.