Error with Paypal Auto-Return URL

so is the hack only for pro?

No, this is for the s2Member Framework, the free version. :slight_smile:

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.