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.

PayPal Pro Failed Payment IPNs being ignored

Home Forums Community Forum PayPal Pro Failed Payment IPNs being ignored

This topic contains 14 replies, has 3 voices. Last updated by  Jason (Lead Developer) 3 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 19th, 2013 at 8:57 am #42474

Hi,

I’ve had s2member Pro running on our site since December 2011. We have a yearly recurring subscription, so we had our first renewals back in December 2012. The problem is, that s2member is not cancelling accounts after PayPal has attempted to take payment twice (the value in my RRA option on Pro forms).

Ever since December, whenever a recurring subscription fails, the following will happen;

– I get an email from PayPal to say it will try again
– The s2member IPN log gets a txn type ‘recurring_payment_failed’ and says it doesn’t need to action this
– PayPal tries again and again, and then sends me an email stating ‘You didn’t get your payment’
– s2member still gets a ‘recurring_payment_failed’ message and again says it didn’t need to action this

As a result for every single failed transaction I’m having to manually go into PayPal, find the subscription and cancel it. Which is starting to drive me crazy, as we have 3-4 each day to manage.

I’ve been in constant touch with PayPal, and they’re pointing the finger at s2member.

Do you guys have any ideas? As an example, here’s an IPN log received today from PayPal, the moment that it sent me a ‘You didn’t get your payment’ message. I’ve hashed out the user info and my personal email from this:

PHP v5.2.17 :: WordPress® v3.4.2 :: s2Member® v120703 :: s2Member® Pro v120703
Memory 65.45 MB :: Real Memory 67.25 MB :: Peak Memory 66.58 MB :: Real Peak Memory 67.25 MB
www.smartinsights.com/?s2member_paypal_notify=1
User-Agent: 
array (
  'payment_cycle' => 'Yearly',
  'txn_type' => 'recurring_payment_failed',
  'last_name' => '###############',
  'next_payment_date' => '02:00:00 Feb 09, 2014 PST',
  'residence_country' => 'GB',
  'initial_payment_amount' => '0.00',
  'rp_invoice_id' => '1360447736:1 Y:1 Y~www.smartinsights.com~1',
  'currency_code' => 'GBP',
  'time_created' => '02:09:00 Feb 10, 2012 PST',
  'verify_sign' => 'AItutYbIN15x-6SG2kM20CWsupsOAxnGLf3syCcpbTPoGrmc8odEyoxI',
  'period_type' => 'Regular',
  'payer_status' => 'unverified',
  'tax' => '0.00',
  'payer_email' => '###############',
  'first_name' => '###############',
  'receiver_email' => '#############',
  'payer_id' => 'L8SKL9ETPKDCJ',
  'product_type' => '1',
  'shipping' => '0.00',
  'amount_per_cycle' => '196.99',
  'profile_status' => 'Active',
  'charset' => 'windows-1252',
  'notify_version' => '3.7',
  'amount' => '196.99',
  'outstanding_balance' => '196.99',
  'recurring_payment_id' => 'I-HWR1DB8JM0J2',
  'product_name' => 'Smart Insights Expert membership: £197 (inc 20% VAT @ £39.40)',
  'ipn_track_id' => '60804bf2630f',
  's2member_log' => 
  array (
    0 => 'IPN received on: Tue Feb 19, 2013 12:45:22 pm 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 ( `subscr_failed|recurring_payment_failed|recurring_payment_skipped` ).',
    4 => 'This `txn_type` does not require any action on the part of s2Member.',
    5 => 's2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.',
    6 => 'When multiple consecutive payments fail, a special IPN response will be triggered.',
  ),
  'subscr_gateway' => 'paypal',
  'custom' => 'www.smartinsights.com',
  'item_number' => '1',
  'subscr_id' => 'I-HWR1DB8JM0J2',
  'item_name' => 'Smart Insights Expert membership: £197 (inc 20% VAT @ £39.40)',
)

I’m really stuck with this – I don’t know what to say to PayPal as they’re adamant the system is working from their end. Any assistance you guys could offer would be gratefully received – it’s a nightmare to manage this at the moment!

Cheers in hope,

Stu

List Of Topic Replies

Viewing 14 replies - 1 through 14 (of 14 total)
Author Replies
Author Replies
Posted: Wednesday Feb 20th, 2013 at 7:17 am #42562

Hi Stuart.

What did you set your rra attribute to in your pro-form/button? [hilite path]Dashboard -› s2Member® -› PayPal® Pro Forms -› Shortcode Attributes -> rra[/hilite]

rra=”2″ Reattempt failed payments? Possible values: 0 = do NOT reattempt billing when/if a recurring payment fails; 1 or higher = yes, DO reattempt billing when/if a recurring payment fails. With PayPal® Pro integration, PayPal® will retry a maximum of 2 times whenever rra=”2″; after that, a Subscription would be terminated due to Max Failed Payments having been reached. With PayPal® Pro integration, the value of this attribute also configures Max Failed Payments. So a setting of rra=”2″ means that you allow a maximum of 2 failed payments.

Is PayPal done with the reattempts when s2Member says it doesn’t have to do anything yet, or will PayPal still keep attempting to get the payment? Does PayPal let you edit the reattempt failed payments setting for the existing subscriptions?

Posted: Wednesday Feb 20th, 2013 at 7:29 am #42564

Hi Cristián,

I mentioned in my original post that the RRA is set to 2. What’s happening is that even after two attempts, PayPal is sending the message I copied in above – a ‘payment failed’ message, which s2member isn’t doing anything with. PayPal then does not send anything else, and I therefore need to manually cancel the subscription at PayPal’s end.

Should s2member not be cancelling these as it’s the final message from PayPal? That’s what PayPal are saying.

Thanks,

Stu

Posted: Thursday Feb 21st, 2013 at 2:02 am #42651
Staff Member

Thanks for the heads up on this thread :-)

s2Member® waits for one of these IPN txn_type values before it does anything.

subscr_eot
recurring_payment_expired
recurring_payment_suspended_due_to_max_failed_payment
recurring_payment_profile_cancel

s2Member® also deals with refunds/chargebacks, and these are indicated by IPNs that include payment status values like: refunded, reversed, reversal or initial_payment_status=failed

Posted: Thursday Feb 21st, 2013 at 2:34 am #42661

Hi Jason,

Thanks. Refunds and manual cancellations through PayPal filter back into s2member just fine. But I’m not getting any of;

subscr_eot
recurring_payment_expired
recurring_payment_suspended_due_to_max_failed_payment

..from PayPal, even long after I receive my ‘You didn’t get your payment’ email message. Instead it seems to send another ‘failed payment’ message.

Have you guys ever experienced anything like this? Seems like an issue with PayPal, but they’re not owning up and I’m completely stuck otherwise!

Thanks,

Stu

Posted: Thursday Feb 21st, 2013 at 2:56 am #42665
Staff Member

Thanks for the follow-up :-)

Please post a Dashboard login privately and we’ll inspect your log files overall. Maybe we will spot something for you. Thanks! Please use: s2Member® » Private Contact Form

Posted: Thursday Feb 21st, 2013 at 4:11 am #42682

Hi Jason,

Just sent the logins via the private contact form – thanks in advance!

Stu

Posted: Thursday Feb 21st, 2013 at 9:48 am #42725
Staff Member

Details received. Thank you!

However, I was unable to gain Dashboard access. Can you please check these and then re-submit? Thanks!

Posted: Thursday Feb 21st, 2013 at 9:58 am #42729

Sorry, don’t know what happened there – have sent them again for you.

Posted: Thursday Feb 21st, 2013 at 10:00 am #42730
Staff Member

Details received. Thank you!

~ Investigating. Thanks for your patience.

Posted: Thursday Feb 21st, 2013 at 11:07 am #42739

Hi Jason,

Just got the following from PayPal – hopefully it might help! They seem to be suggesting that they’re not receiving a MAXFAILEPAYMENTS variable. I assume that’s the same thing as we set in the RRA param in the s2member shortcode?

Dear Stuart, 

Apologies for any inconveniences.

With regard this issue "PayPal is not terminating user subscriptions after a number of failed payments" you should use the variable MAXFAILEDPAYMENTS 

MAXFAILEDPAYMENTS 
(Optional) Number of scheduled payments that can fail before the profile is automatically suspended. An IPN message is sent to the merchant when the specified number of failed payments is reached.
Character length and limitations: Number string representing an integer

You can find here what IPN variables and values you should receive for your recurring payments: 

https://www.x.com/developers/paypal/documentation-tools/ipn/integration-guide/IPNandPDTVariables#id08CTB0S055

https://www.x.com/sites/default/files/ipnguide.pdf - page 52

If you are using Standard Subscription you can find below

subscr_cancel Subscription canceled 
subscr_eot Subscription expired 
subscr_failed Subscription payment failed 
subscr_modify Subscription modified 
subscr_payment Subscription payment received 
subscr_signup Subscription started

For a Recurring Payment (create from API call)

This is the value you will receive if the payment will fail:
txn_type=recurring_payment_failed

Recurring payment received recurring_payment 
Recurring payment expired recurring_payment_expired
Recurring payment profile created recurring_payment_profile_created
Recurring payment skipped recurring_payment_skipped

If you can send me few examples, I can investigate further for you. 

Many thanks
Kind Regards
Federica
PayPal MTS

Cheers,

Stu

Posted: Saturday Feb 23rd, 2013 at 1:14 am #42897
Staff Member

Thanks for your patience.

I just completed an investigation of your site; and I also reviewed your s2Member log files.

I find there are no IPNs from PayPal to indicate that a Recurring Profile has been terminated or expired due to having reached your MAXFAILEDPAYMENTS value of 2. This has not occurred yet on your installation.

I do see several failed payments, but nothing that s2Member should respond to yet. s2Member will wait for one of these IPN txn_type values before it triggers an EOT event for a paying Member.

subscr_eot
recurring_payment_expired
recurring_payment_suspended_due_to_max_failed_payment
recurring_payment_profile_cancel

s2Member® also deals with refunds/chargebacks, and these are indicated by IPNs that include payment status values like: refunded, reversed, reversal or initial_payment_status=failed


I also confirmed that s2Member is sending the MAXFAILEDPAYMENTS and AUTOBILLOUTAMT variables on your installation. And we are. You are correct, this is controlled by the s2Member rra="" Shortcode Attribute.

As seen in your paypal-api.log file.

'AUTOBILLOUTAMT' => 'AddToNextBilling',
'DESC' => 'Smart Insights Expert membership',
'MAXFAILEDPAYMENTS' => '2',
Dashboard -› s2Member® -› PayPal Pro Forms -› Shortcode Attributes (Explained)
rra="2" Reattempt failed payments? Possible values: 0 = do NOT reattempt billing when/if a recurring payment fails; 1 or higher = yes, DO reattempt billing when/if a recurring payment fails. With PayPal® Pro integration, PayPal® will retry a maximum of 2 times whenever rra=”2″; after that, a Subscription would be terminated due to Max Failed Payments having been reached. With PayPal® Pro integration, the value of this attribute also configures Max Failed Payments. So a setting of rra=”2″ means that you allow a maximum of 2 failed payments.

Possible Solutions for you…

I think part of the problem here, is that you are billing on a Yearly basis. Unfortunately, there is no PayPal API parameter that allows s2Member® to specify when billing should be reattempted in the event of failure. This is left in the hands of PayPal (and/or whatever agreement you have with PayPal). Failed payments are supposed to be retried every few days, not every year. See this related thread.

However, it appears from your log files that a failed payment is being rescheduled for a retry the following year (not anytime soon). Thus, allowing MAXFAILEDPAYMENTS=2, could mean that you allow a customer to fail payment for up to 2 years; and not until the 3rd failed payment in their 3rd year would the account be suspended.

So here are two possible solutions:

1. Contact PayPal and find out what can be done with your account to have payments automatically retried within 10 days of the initial failed payment having occurred. From what I understand, this is supposed to be retried every few days, not every year. See this related thread.

2. Or, do not allow failed payments (i.e. rra="0" in your s2Member® Shortcode).

Also, it never hurts to allow a customer to keep billing information up-to-date.
See: Dashboard -› s2Member® -› PayPal® Pro Forms -› Billing Update Forms
This can help you avoid failed payments, by asking for up-to-date details about their billing method (i.e Mr. Customer — please enter your latest credit card number and expiration date).
Posted: Tuesday Mar 5th, 2013 at 12:18 pm #43793

Hi Jason,

Wanted to respond on this so that the solution is in place for anyone else experiencing the problem.

After a lot of discussion with PayPal, you’re correct – with MAXFAILEDPAYMENTS set to 2 via the s2member RRA value, PayPal will;

  1. Attempt to take payment at the end of the first billing cycle (in my case one year after first sign up)
  2. If it fails, it’ll wait 5 days then try again, then 5 days then try again, then set MAXFAILEDPAYMENTS to 1
  3. It’ll then wait a FULL billing cycle (so a year in my case) to try 1 + 2 again
  4. As soon as MAXFAILEDPAYMENTS hits 2, it’ll cancel the subscription and send the correct IPN

Effectively, it’s a bit broken for yearly subscriptions, really. PayPal that is – not s2! PayPal won’t/can’t update old subs on your behalf, so I’m currently faced with manually updating 810 records in PayPal’s shoddy management console. *sobs*

One final thing – you mention (as does the in plugin documentation) that setting RRA/MAXFAILEDPAYMENTS to zero will mean it won’t try again and terminate after the first attempt. This is incorrect. For the last two weeks I’ve had RRA set to zero, and all my new profiles since then are now set to “Never expire” in PayPal.

RRA/MAXFAILEDPAYMENTS must therefore be set to 1 if people want it to terminate after attempting 3 times in 15 days at the first renewal date.

Anyone fancy manually updating 810 profiles for me? :(

Posted: Friday Mar 8th, 2013 at 4:33 am #44040

Thank you very much for the update, Stewart! I’m glad you sorted it out, although I’m sorry you’ll have to go through all that manual editing…

One final thing – you mention (as does the in plugin documentation) that setting RRA/MAXFAILEDPAYMENTS to zero will mean it won’t try again and terminate after the first attempt. This is incorrect. For the last two weeks I’ve had RRA set to zero, and all my new profiles since then are now set to “Never expire” in PayPal.

RRA/MAXFAILEDPAYMENTS must therefore be set to 1 if people want it to terminate after attempting 3 times in 15 days at the first renewal date.

I’ll notify Jason so he can review it. Thanks!

Posted: Friday Mar 8th, 2013 at 7:05 am #44058
Staff Member

Thanks for the heads up on this thread :-)

I am VERY sorry. You are correct on this point; I was wrong.
I’m having the s2Member® documentation updated to better explain this.
MAX FAILED PAYMENTS
rra="2" Reattempt billing when/if a recurring payment fails; exactly X number of times; and then automatically suspend the customer’s account (e.g. the customer loses access). By default, PayPal® will retry a maximum of 2 times whenever rra="2"; after that, a Subscription would be terminated due to Max Failed Payments having been reached. The value of this attribute configures Max Failed Payments. A setting of rra="2" means that you allow a maximum of 2 failed payments. Setting rra="0" means that you allow an infinite number of failed payments.

From the PayPal® API docs…

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.