1
votes

I try to establish recurring payment from CiviCRM, using Website Payments Pro mode. The positive testing works perfectly, I see the created payment profile, I get the IPN notifications, it's perfect.

I enabled negative testing at the profile, I tried two methods to trigger the negative case - when the initial payment fails:

PayPal recurring payments negative testing (https://developer.paypal.com/docs/classic/lifecycle/sb_error-conditions/ - with the amount of 106.10 $)

With IPN error code: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNTesting/ - 31.22

In both cases, the payment completed successfully.

I contacted the paypal support and their best answer was this:

" You can test it with close expiry date. Usually when the expiry date almost come, PayPal will sent notification to the buyer to change credit card. But if the buyers just ignore the notification, it will lead to failed transaction. "

Even if it works, it's unacceptable, that I might have to wait 1 month to see the result. Paypal does not allow to set already expired card for the recurring payment profile.

Do you see an efficient way to test negative outcome? Maybe with IPN simulator? But how can I be sure that Send Paypal Recurring Payments commands with IPN Simulator contains the proper messages that PayPal uses today for my type of account?

2

2 Answers

1
votes

Here is how to proceed: forget the sandbox, it is just not mature enough. Use the production/live paypal account, lower the recurring fee to 0.5$, launch the recurring payment from Civicrm, wait for the initial payment, you have the successful case, then ask your bank to set the POS limit to 0$, then the next recurring payment will fail. This is a totally robust way to test negative case. Do not forget to set your IPN first (https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/). Do you have any better method?

0
votes

The following method works for recurring payments with Express Checkout, might as well work for Payments Pro:

  1. Login to https://www.sandbox.paypal.com using your buyer's test PayPal account.
  2. Replace the contents of the street address Line-1 of the buyer's test credit card, with CCREJECT-REFUSED.
  3. Execute a typical Express Checkout payment flow against the Sandbox test environment using the same buyer account and with the same credit card that you just modified.

This method is described on a page in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying 'Beware of the Leopard' helpfully titled How To Recover from Funding Failure Error Code 10486 in Express Checkout