Hi Milan, how do you change the default-return file? I need some kind of solution until a fix is found. Thanks!
Error with Paypal Auto-Return URL
Hi Bob… You must connect to your hosting via FTP or through cPanel and then go to /public_html/wp-content/plugins/s2member/src/includes/templates/returns
You will find default-return.php file in there. Open it, find where is written %%response%% and just change it with %%continue%%
This means that instead of showing response messages it will just direct you to homepage of the website.
Hope this helps just until they release the fix.
Best,
Milan
Thanks mate, will give that a crack until there’s a solution. Appreciate it!
edit: works great for now. Is there a way to add text to that pages, up where it says ‘site name says…’ - could I add some text after ‘says…’
You are welcome. I believe there is a way how to change template page to give a different message but I didnt go deep into it due to lack of time. Maybe guys from s2member could give us some advice how to customize that page until the issue is resolved?
Point is that everything else works fine so there is no reason to present this error message to users, I’m sure there can be some temporary workaround just for the sake of user experience until they release final fix.
Yeah, it’s not ideal to not have a way to see if a problem does happen. But for the sites that for some reason are getting this behavior, it’ll be less often to have a real problem than this incorrect error message.
Rather than editing the s2Member file, though, if you have s2Member Pro, I do think it’s better to use a custom template for that return page. See: WP Admin > s2Member Pro > PayPal Options > PDT / Auto-Return > Auto-Return Page Template
It is also possible to build your own Auto-Return Page Template, if you prefer. If you feel the need to create your own Auto-Return Page Template, please make a copy of s2Member’s default template:
s2member/src/includes/templates/returns/default-template.php
. Place your copy of this default template, inside your active WordPress theme directory, and name the file:paypal-return.php
. s2Member will automatically find your Auto-Return Page Template in this location, and s2Member will use your template instead of the default. Further details are provided inside s2Member’s default template file.
Hi Cristian, thanks for your answer. I’m free user of s2member so can I use second option you mentioned: to make a copy of s2Member’s default template: s2member/src/includes/templates/returns/default-template.php and place it inside active WordPress theme directory with the name of the file: paypal-return.php.
Will that work on s2member free plugin version?
No, you’d need s2Member Pro for the custom template.
I did a bunch of testing, and so far this hack is working reliably. It’s not good if there is an actual error, in which case it’ll just keep looping, but for those having this issue, where the error message is shown although the transaction is fine, it’d be okay. Thanks Josh for sharing it.
I’m attaching a file with the hack applied. Just has to be uploaded to s2member/src/includes/classes/
paypal-return-in-inc.php.zip (3.9 KB)
I run 2 sites with 5,000+ members, like everyone else here we have been experiencing the same issues since November/December 2018, on average I receive 10 support emails per day, per site from new sign ups that receive this error.
Yesterday I installed the patch and for the first time in months I woke up to no support emails! I checked PayPal and the website and we have had successful registrations! Fingers crossed this is resolve now. Thank you Clavaque for your hard work on this. I created my account on here just to post and say thanks!
Thank you Mark! I’m sooo glad to get this feedback! I was hoping it’s working well for more sites, not just my tests.
And thank @WarpConduit for sharing his solution, as well. I tried many things, and his was the best I found for this behavior so far.
PRO is so great with membership sites - it avoids the hassle of customers having to locate the registration email - they have to register prior to payment, so it really increases the conversion rates too. Gillian
used the patch and users are still getting the error on return… am i the only one left?
so is the hack only for pro?
used the patch and users are still getting the error on return… am i the only one left?
I did a test on your site and it worked fine, no errors. Check the message I sent you.
so is the hack only for pro?
No, this is for the s2Member Framework, the free version.
I’m bringing this old topic back up again - I think this happened because paypal timed out, right?
I still see this problem on about 0.5% of all subscription transactions.
On some days it happens a lot - e.g. 01. May was crazy. Then many days happens never. Usually it happens for several transactions in a short timeframe (but not for every transaction during that timeframe, only about 1/3).
It rarely happens on new sign ups (maybe like 1 out of 1000) - but happens pretty often for subscriptions! Now in this case the user pays, the IPN log shows:
LOG ENTRY: Sun Jun 27th, 2021 @ precisely 11:51 am UTC
PHP v8.0.5 :: WordPress v5.7.2 :: s2Member v210526 :: s2Member Pro v210526
Memory 9.56 MB :: Real Memory 4.00 MB :: Peak Memory 9.72 MB :: Real Peak Memory 4.00 MB
openmtbmap.org/?s2member_paypal_notify=1
User-Agent: PayPal IPN ( https://www.paypal.com/ipn )
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] => Please see this KB article: http://www.s2member.com/kb/server-scanner/
. We suggest that you run the s2Member Server Scanner.
[2] => array (
‘s2member_paypal_notify’ => ‘1’,
then the confidential data
Now this is very troublesome as I need s2member to behave correctly on subscription payments too - else the customer does not get an invoice. The customers are alright - all the data is correct. So often the payment for the same customer went through correctly for a couple of years - only then on that day to get that unable to verify error.
Did this fix miss subscriptions payments? Or does this fix simply not loop long enough if it cannot contact the paypal servers?
If I send the IPN again from paypal (of course only possible within 7 days) then usually (as this bug is rare) it will work well.
Yes before this patch this happened even more often - as new payments were affected very often too.
It would really be good if this could be fixed for subscriptions too! Or change the loop to run 2-3 times as long if maybe on subscriptions it takes longer?
On another 0.5% of subscription payments - I receive a subscription payment from paypal - and it does not show in any log! Paypal shows IPN received however in the IPN dashboard… I think those would be even harder to analyse what is happening (again happening to subscribers were the subscription worked just fine in previous payments).
oh yeah - I am sure every user of s2member using paypal subscriptions is affected by this bug. However if you do not run any custom events like invoices firing on subscription payment arriving - you will not notice.
Every quarter I download all invoices that I sent out, download the logs from paypal and stripe - then check if for every payment an invoice was written in spreadsheet - and then manually create invoices for all missed payments.
Sometimes the whole payment is missing in the IPN log. Sometimes (more often) the above error. Not sure what to do about payments where the IPN log is not recording anything.
here is a full log with personal details starred out :
LOG ENTRY: Sun Jun 27th, 2021 @ precisely 11:51 am UTC
PHP v8.0.5 :: WordPress v5.7.2 :: s2Member v210526 :: s2Member Pro v210526
Memory 9.56 MB :: Real Memory 4.00 MB :: Peak Memory 9.72 MB :: Real Peak Memory 4.00 MB
openmtbmap.org/?s2member_paypal_notify=1
User-Agent: PayPal IPN ( https://www.paypal.com/ipn )
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] => Please see this KB article: http://www.s2member.com/kb/server-scanner/
. We suggest that you run the s2Member Server Scanner.
[2] => array (
‘s2member_paypal_notify’ => ‘1’,
‘mc_gross’ => ‘13.00’,
‘invoice’ => '5770e8562fbd7~193.171.196.’,
‘protection_eligibility’ => ‘Eligible’,
‘address_status’ => ‘confirmed’,
‘payer_id’ => 'XLQNRYGZ9K**’,
‘address_street’ => ‘Kra****’,
‘payment_date’ => ‘04:50:23 Jun 27, 2021 PDT’,
‘payment_status’ => ‘Completed’,
‘charset’ => ‘windows-1252’,
‘address_zip’ => ‘8020’,
‘first_name’ => ‘’,
‘option_selection1’ => ‘openmtbmap.org’,
‘option_selection2’ => '193.171.196.’,
‘mc_fee’ => ‘0.70’,
‘address_country_code’ => ‘AT’,
‘address_name’ => ‘****’,
‘notify_version’ => ‘3.9’,
‘subscr_id’ => 'I-VP2Y4RM24’,
‘custom’ => 'openmtbmap.org|193.171.|AT|AT|+43-’,
‘payer_status’ => ‘verified’,
‘business’ => '@gmail.com’,
‘address_country’ => ‘’,
‘address_city’ => ‘Graz’,
‘verify_sign’ => ‘AF7tNjcPnsOKC0KShsgTPKk***************’,
‘payer_email’ => ‘<@gmail.com’,
‘option_name1’ => ‘Originating Domain’,
‘option_name2’ => ‘Customer IP Address’,
‘txn_id’ => '8D199’,
‘payment_type’ => ‘instant’,
‘last_name’ => '’,
‘address_state’ => ‘’,
‘receiver_email’ => ‘*****@gmail.com’,
‘payment_fee’ => ‘’,
‘receiver_id’ => 'Z89X4K6’,
‘txn_type’ => ‘subscr_payment’,
‘item_name’ => ‘First year access for €20, then €13 each year (recurring_charge, for OpenMTBMap access)’,
‘mc_currency’ => ‘EUR’,
‘item_number’ => ‘1’,
‘residence_country’ => ‘AT’,
‘transaction_subject’ => ‘First year access for €20, then €13 each year (recurring_charge, for OpenMTBMap access)’,
‘payment_gross’ => ‘’,
‘ipn_track_id’ => '*’,
)
)
)
BTW - I*m still from time to time running into the Unable to verify $_POST vars.
Usually resending the paypal IPN will always work. So I think sleep should be extended to 5 seconds over 3 seconds - and another full round of tries should be done.before aborting.
If s2member aborts then the user isn’t created or the payment not credited to the account / or user not demoted when the payment failed. With 5 seconds over 3 seconds it helps already again a tiny bit.
Also sleep 3 means anything from 2-3 seconds. Sleep 5 anything from 4-5 seconds.
I had a customer email me the other day saying they received “Error. Please contact Support for assistance.” when trying to renew. They eventually got it to work but only after trying 3 times.