Skip to content

Commit

Permalink
Fix for issue #141
Browse files Browse the repository at this point in the history
  • Loading branch information
adixon committed Jun 15, 2016
1 parent 0a24388 commit f762193
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 15 additions & 2 deletions iats.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,12 @@ function _iats_civicrm_get_payment_processor_id($contribution_recur_id) {
$params = array(
'id' => $contribution_recur_id,
);
$result = civicrm_api3('ContributionRecur', 'getsingle', $params);
try {
$result = civicrm_api3('ContributionRecur', 'getsingle', $params);
}
catch (CiviCRM_API3_Exception $e) {
return FALSE;
}
if (empty($result['payment_processor_id'])) {
return FALSE;
// TODO: log error
Expand All @@ -555,10 +560,18 @@ function _iats_civicrm_get_payment_processor_id($contribution_recur_id) {
* This function relies on our naming convention for the iats payment processor classes, staring with the string Payment_iATSService
*/
function _iats_civicrm_is_iats($payment_processor_id) {
if (empty($payment_processor_id)) {
return FALSE;
}
$params = array(
'id' => $payment_processor_id,
);
$result = civicrm_api3('PaymentProcessor', 'getsingle', $params);
try {
$result = civicrm_api3('PaymentProcessor', 'getsingle', $params);
}
catch (CiviCRM_API3_Exception $e) {
return FALSE;
}
if (empty($result['class_name'])) {
return FALSE;
// TODO: log error
Expand Down
6 changes: 3 additions & 3 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<author>Alan Dixon</author>
<email>iats@blackflysolutions.ca</email>
</maintainer>
<releaseDate>2016-06-14</releaseDate>
<version>1.5.1</version>
<releaseDate>2016-06-15</releaseDate>
<version>1.5.2</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.4</ver>
<ver>4.5</ver>
<ver>4.6</ver>
</compatibility>
<comments>This release (1.5.1) includes a security update and is strongly recommended for all installs.
<comments>This release (1.5.2) includes a security update and is strongly recommended for all installs.
</comments>
<civix>
<namespace>CRM/iATS</namespace>
Expand Down

0 comments on commit f762193

Please sign in to comment.