Skip to content

Commit

Permalink
Merge branch 'master' of github.com:iATSPayments/com.iatspayments.civ…
Browse files Browse the repository at this point in the history
…icrm
  • Loading branch information
adixon committed Mar 8, 2023
2 parents 6993de3 + 8fa7d81 commit aef2345
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 20 deletions.
8 changes: 0 additions & 8 deletions CRM/Core/Payment/Faps.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,6 @@ public function doPayment(&$params, $component = 'contribute') {
return _iats_payment_status_complete();
}

// Check for valid currency [todo: we have C$ support, but how do we check,
// or should we?]
if (
'USD' != $params['currency']
&& 'CAD' != $params['currency']
) {
return self::error('Invalid currency selection: ' . $params['currency']);
}
$isRecur = CRM_Utils_Array::value('is_recur', $params);
if ($isRecur && empty($params['contributionRecurID'])) {
return self::error('Invalid call to doPayment with is_recur and no contributionRecurID');
Expand Down
5 changes: 0 additions & 5 deletions CRM/Core/Payment/FapsACH.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ public function doPayment(&$params, $component = 'contribute') {
return _iats_payment_status_complete();
}

// Check for valid currency
$currency = $params['currency'];
if (('USD' != $currency) && ('CAD' != $currency)) {
return self::error('Invalid currency selection: ' . $currency);
}
$isRecur = CRM_Utils_Array::value('is_recur', $params);
if ($isRecur && empty($params['contributionRecurID'])) {
return self::error('Invalid call to doPayment with is_recur and no contributionRecurID');
Expand Down
4 changes: 2 additions & 2 deletions CRM/Iats/iATSServiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ public function result($response, $log = TRUE) {
case 'process':
if (!empty($response->PROCESSRESULT)) {
$processresult = $response->PROCESSRESULT;
$result['auth_result'] = trim(current($processresult->AUTHORIZATIONRESULT));
$result['remote_id'] = current($processresult->TRANSACTIONID);
$result['auth_result'] = trim(((array) $processresult->AUTHORIZATIONRESULT)[0] ?? '');
$result['remote_id'] = ((array) $processresult->TRANSACTIONID)[0] ?? '';
// If we didn't get an approval response code...
// Note: do not use SUCCESS property, which just means iATS said "hello".
$result['status'] = (substr($result['auth_result'], 0, 2) == self::iATS_TXN_OK) ? 1 : 0;
Expand Down
2 changes: 0 additions & 2 deletions api/v3/Job/Iatsreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function civicrm_api3_job_iatsreport($params) {
foreach ($process_methods_per_type as $method => $payment_status_id) {
// initialize my counts
$processed[$user_name][$type][$method] = 0;
// watchdog('civicrm_iatspayments_com', 'pp: <pre>!pp</pre>', array('!pp' => print_r($payment_processor,TRUE)), WATCHDOG_NOTICE);
/* get approvals from yesterday, approvals from previous days, and then rejections for this payment processor */
/* we're going to assume that all the payment_processors_per_type are using the same server */
$iats_service_params['method'] = $method;
Expand Down Expand Up @@ -187,7 +186,6 @@ function civicrm_api3_job_iatsreport($params) {
}
}
Civi::settings()->set('iats_journal', $iats_journal);
// watchdog('civicrm_iatspayments_com', 'found: <pre>!found</pre>', array('!found' => print_r($processed,TRUE)), WATCHDOG_NOTICE);
$message = '';
foreach ($processed as $user_name => $p) {
foreach ($p as $type => $ps) {
Expand Down
2 changes: 1 addition & 1 deletion api/v3/Job/Iatsverify.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function civicrm_api3_job_iatsverify($params) {
// Restore source field and trxn_id that completetransaction overwrites
civicrm_api3('contribution', 'create', array(
'id' => $contribution['id'],
'source' => $contribution['source'],
'source' => ($contribution['contribution_source'] ?? $contribution['source']),
'trxn_id' => $trxn_id,
));
break;
Expand Down
4 changes: 2 additions & 2 deletions js/dd_cad.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CRM.$(function ($) {
});
$('#cad_bank_number').blur(function(eventObj) {
var myCount = onlyNumbers($(this));
if (myCount != 3) {
if ((myCount > 0) && (myCount != 3)) {
$(this).crmError(ts('Your Bank Number requires three digits, use a leading "0" if necessary'));
}
switch($(this).val()) {
Expand All @@ -48,7 +48,7 @@ CRM.$(function ($) {
});
$('#cad_transit_number').blur(function(eventObj) {
var myCount = onlyNumbers($(this));
if (myCount != 5) {
if ((myCount > 0) && (myCount != 5)) {
$(this).crmError(ts('Your Bank Transit Number requires exactly five digits'));
}
iatsSetBankIdenficationNumber();
Expand Down

0 comments on commit aef2345

Please sign in to comment.