1

We're newer to online contributions and are getting ready for go-live soon. Credit cards with iATS have processed through with no hiccups. We recently also enabled ACH/EFT via iATS as a payment instrument for our site. Our first ACH/EFT transaction (from me) went through fine. The transaction was initiated on 7/21/16; both iATS and my personal bank recognize the transaction is now completed as of yesterday, 7/26/16.

However, CiviCRM still showed the transaction's status as Pending (Incomplete Transaction). The scheduled job for iATS Payments Verification (API Entity: Job; API Action: iatsacheftverify) is enabled and is being processed Hourly (by default; I've changed nothing about the job). However, when I view the Job Log, I only see the job starting, never finishing:

Entity: Job Action: iatsacheftverify

Summary

Starting execution of iATS Payments Verification

Details

Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}

Full message: Starting execution of iATS Payments Verification

When I upgraded the iATS extension to 1.5.3 (from 1.5.2) this afternoon and manually executed the job, the job finished and the transaction updated. Now that a few hours have passed and more hourly jobs ran, it has resumed not working. I manually executed it again, and the job finished.

So, the issue appears to be that the job finishes when manually executed, but not automatically on its own. Any ideas on how to proceed? Do I have to configure a cron job specific to/for that scheduled job?

The iATS requirements (#5) specify: "To handle ACH/EFT Contributions (verification of them) and to handle Recurring Contributions (of any type) you must configure cron for your CiviCRM install. Information about how to do this can be found in: http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs," but I do have cron running. The iATS Payments Recurring Contributions scheduled job (Entity: Job Action: iatsrecurringcontributions) is running daily (again, by default; I've changed nothing) and has both Starting and Finishing in the Job Log. For example:

Entity: Job Action: iatsrecurringcontributions

Summary

Finished execution of iATS Payments Recurring Contributions with result: Success (No contribution records were processed.)

Details

Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}

Full message: Finished execution of iATS Payments Recurring Contributions with result: Success (No contribution records were processed.)


ADDITION: If I run job.iatsacheftverify from the API Explorer, I get a success. So I tried adding this scheduled job to my server (from Plesk, CentOS 7, no brackets): drush -r {root folder} -l {website URL} civicrm-api -u {user} job.iatsacheftverify --quiet. When I ran that job I received this error:

PHP Fatal error: Class 'SoapClient' not found in {ROOT}/sites/default/files/civicrm/extensions/com.iatspayments.civicrm/CRM/iATS/iATSService.php on line 164
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'SoapClient' not found in
{ROOT}/sites/default/files/civicrm/extensions/com.iatspayments.civicrm/CRM/iATS/iATSService.php,
line 164

Line 163-164 of that file:

/* until iATS fixes it's box verify, we need to have trace on to make the hack below work */
$soapClient = new SoapClient($this->_wsdl_url, array('trace' => 1,'soap_version' => SOAP_1_2));

I have no idea what that does. :-)

Civi 4.6.14 (will be updating to 4.6.19 before go-live); Drupal 7.44; iATS Payments extension 1.5.3

2
  • Hi Allen, I'm not a developer so please forgive my lack of precise technical instruction, but I have run into this issue before when another scheduled job was causing the global cron to fail before it got to the iATS scheduled job - I believe the jobs are run in sequence as they appear in the scheduled job listing page, so check the last run time stamps to see if you can identify which job may be the cause. This issue also occurs when there is a grid lock between scheduled jobs - I have just run into the issue in a dev environment where manual execution was starting nut never finishing... Commented Jul 28, 2016 at 15:40
  • If all else fails, @karing should be able to help you the most with this issue Commented Jul 28, 2016 at 15:41

1 Answer 1

2

Your symptoms suggest that the issue is some kind of fatal error happening during the job execution itself. I'd recommend you run the job directly via the command line, i.e. something like

drush -u 1 cvapi job.iatsverify

And see if there are any errors showing up. Make sure it's the same php version ...

My guess is some curious error that our code isn't handling properly. If you try turning on some logging it might be more instructive.

To answer your other questions: 1. No, you don't need to schedule a separate cron, it should run okay 'out of the box' (it calls in hourly for verifications, it really wants to tell you when your contributions are actually going through). 2. Tamar's diagnosis is interesting - I did implement job locking to prevent recurring payments from getting generated multiple times, but that shouldn't affect the verification, which is a separate job and can happen multiple times in parallel without ill effect. 3. Your civi version doesn't look terrible, but there have been a number of civi core fixes in the 4.6.x recent release that may affect some things, I'd recommend you update your testing platform as well. There is some testing for versions in the iats extension, but doesn't try to manage all the older minor version quirks.

From the comments below: Since you receive a "PHP Fatal error: Class 'SoapClient' not found" when you run the Drush command that means your drush is running a different php environment from your web interface. That's not untypical, you'll just need to inspect your php configurations and make sure that the php cli used by drush also has the soap extension. You can test that by running "php -i | grep soap" for example.

5
  • Alan, thank you for your help. I just tried something similar (while you were posting!) and received a PHP Fatal error: Class 'SoapClient' not found (see new addition to original post). Any idea why there is no error if I manually execute the job from the Scheduled jobs page, but there is an error via Drush? Commented Jul 28, 2016 at 17:43
  • I do get the same error as above when I run 'drush cvapi Job.iatsacheftverify sequential=1' from the command line. And I have verified -- SOAP is enabled per phpinfo(). Commented Jul 28, 2016 at 17:50
  • 1
    So that means your drush is running a different php environment from your web interface. That's not untypical, you'll just need to inspect your php configurations and make sure that the php cli used by drush also has the soap extension. You can test that by running "php -i | grep soap" for example.
    – Alan Dixon
    Commented Jul 28, 2016 at 22:07
  • That did it, thank you Alan! My website PHP was 5.6, but Drush and the command line were running 5.4. The Command Line PHP did not have SOAP installed. I found instructions for my server type and got SOAP enabled for the 5.4 version. Lo and behold, the normal CiviCRM cron run using Drush successfully finishes the iATS verification job! Thank you, thank you! Commented Jul 29, 2016 at 4:31
  • Great. So - to go back to my original answer, it would suggest that our current strategy of identifying the missing SOAP extension isn't enough, i.e. we need better error handling for cases where the cli php is different from the web php.
    – Alan Dixon
    Commented Jul 29, 2016 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.