Skip to content

Instantly share code, notes, and snippets.

@twjordan
Created June 24, 2020 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twjordan/68451998a68f072e079536f205486007 to your computer and use it in GitHub Desktop.
Save twjordan/68451998a68f072e079536f205486007 to your computer and use it in GitHub Desktop.
How to test with civiCRM and iATS

Who is this for?

If you manage a civiCRM instance and use iATS for your payment processor and would like to test a contribution, here's what I had to do.

Getting Test Credentials

Log into your 1stPay Transaction Center (https://secure.1stpaygateway.net/secure/transcenter/index.aspx) and go to the Security Settings/Gateway Options page (https://secure.1stpaygateway.net/secure/transcenter/security/security.aspx?target=security_gatewaykey)

Enable test mode. This will create a sandbox for you. This is a test instance of the gateway with its own transaction searches etc. The menu in the upper right hand corner will let you know which instance you are in and if you are in test mode, a large RED banner at the top will say TEST MODE ENABLED.

Make sure you are in the sandbox account and visit the "Gateway Options" page again. You will have a different ProcessorID listed on that page (the transaction center ID and the Merchant Key will be the same as your production instance).

Configuring CiviCRM payment processor

This is frustrating. The CiviCRM iATS payment processor for 1stPay has LIVE and TEST configurations. Unfortunately, it does not seem (at this time) that you can use the TEST configuration in any meaningful sense.

To workaround this, you should create TWO payment processors, one for live and one for test. The only difference in these configurations will be the transaction center ID, so name them appropriately.

Attach this "test" payment processor to your contribution (or other) form that you wish to test.

Testing the form

You will not be able to TEST using the TEST forms built into CiviCRM, you have to TEST with a LIVE form (or copy of your form).

When you test the form you need to use a specific credit card number. You can similate all sorts of error conditions by donating specific amounts with specific cards and CVVs. You can read all about it here (https://support.goemerchant.com/gateway/Docs/Appendix/TestData.html)

For most purposes, the fake VISA 4539394673694021 with any 3 digit CVV and expiry in the future will be what you want.

Cleanup

Remember, since this is NOT using the built in TEST processor, your contributions will look (to CiviCRM) like real payments and you will need to delete them to avoid incorrect totals in CiviContribute reports, etc.

Also, if you are not using a copy of a form so you can TEST on LIVE then make sure you switch your payment processor back.

Next Steps

I think this setup is far from ideal and the developers of the iATS plugin should ensure that the TEST processor setup can work properly with 1stPayGateway and the documentation should be updated to contain the information needed to get it working via workaround until that happens. https://github.com/iATSPayments/com.iatspayments.civicrm/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment