Skip to content

Commit aef2345

Browse files
committed
Merge branch 'master' of github.com:iATSPayments/com.iatspayments.civicrm
2 parents 6993de3 + 8fa7d81 commit aef2345

File tree

6 files changed

+5
-20
lines changed

6 files changed

+5
-20
lines changed

CRM/Core/Payment/Faps.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,6 @@ public function doPayment(&$params, $component = 'contribute') {
272272
return _iats_payment_status_complete();
273273
}
274274

275-
// Check for valid currency [todo: we have C$ support, but how do we check,
276-
// or should we?]
277-
if (
278-
'USD' != $params['currency']
279-
&& 'CAD' != $params['currency']
280-
) {
281-
return self::error('Invalid currency selection: ' . $params['currency']);
282-
}
283275
$isRecur = CRM_Utils_Array::value('is_recur', $params);
284276
if ($isRecur && empty($params['contributionRecurID'])) {
285277
return self::error('Invalid call to doPayment with is_recur and no contributionRecurID');

CRM/Core/Payment/FapsACH.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ public function doPayment(&$params, $component = 'contribute') {
129129
return _iats_payment_status_complete();
130130
}
131131

132-
// Check for valid currency
133-
$currency = $params['currency'];
134-
if (('USD' != $currency) && ('CAD' != $currency)) {
135-
return self::error('Invalid currency selection: ' . $currency);
136-
}
137132
$isRecur = CRM_Utils_Array::value('is_recur', $params);
138133
if ($isRecur && empty($params['contributionRecurID'])) {
139134
return self::error('Invalid call to doPayment with is_recur and no contributionRecurID');

CRM/Iats/iATSServiceRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ public function result($response, $log = TRUE) {
272272
case 'process':
273273
if (!empty($response->PROCESSRESULT)) {
274274
$processresult = $response->PROCESSRESULT;
275-
$result['auth_result'] = trim(current($processresult->AUTHORIZATIONRESULT));
276-
$result['remote_id'] = current($processresult->TRANSACTIONID);
275+
$result['auth_result'] = trim(((array) $processresult->AUTHORIZATIONRESULT)[0] ?? '');
276+
$result['remote_id'] = ((array) $processresult->TRANSACTIONID)[0] ?? '';
277277
// If we didn't get an approval response code...
278278
// Note: do not use SUCCESS property, which just means iATS said "hello".
279279
$result['status'] = (substr($result['auth_result'], 0, 2) == self::iATS_TXN_OK) ? 1 : 0;

api/v3/Job/Iatsreport.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function civicrm_api3_job_iatsreport($params) {
9696
foreach ($process_methods_per_type as $method => $payment_status_id) {
9797
// initialize my counts
9898
$processed[$user_name][$type][$method] = 0;
99-
// watchdog('civicrm_iatspayments_com', 'pp: <pre>!pp</pre>', array('!pp' => print_r($payment_processor,TRUE)), WATCHDOG_NOTICE);
10099
/* get approvals from yesterday, approvals from previous days, and then rejections for this payment processor */
101100
/* we're going to assume that all the payment_processors_per_type are using the same server */
102101
$iats_service_params['method'] = $method;
@@ -187,7 +186,6 @@ function civicrm_api3_job_iatsreport($params) {
187186
}
188187
}
189188
Civi::settings()->set('iats_journal', $iats_journal);
190-
// watchdog('civicrm_iatspayments_com', 'found: <pre>!found</pre>', array('!found' => print_r($processed,TRUE)), WATCHDOG_NOTICE);
191189
$message = '';
192190
foreach ($processed as $user_name => $p) {
193191
foreach ($p as $type => $ps) {

api/v3/Job/Iatsverify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function civicrm_api3_job_iatsverify($params) {
183183
// Restore source field and trxn_id that completetransaction overwrites
184184
civicrm_api3('contribution', 'create', array(
185185
'id' => $contribution['id'],
186-
'source' => $contribution['source'],
186+
'source' => ($contribution['contribution_source'] ?? $contribution['source']),
187187
'trxn_id' => $trxn_id,
188188
));
189189
break;

js/dd_cad.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CRM.$(function ($) {
2121
});
2222
$('#cad_bank_number').blur(function(eventObj) {
2323
var myCount = onlyNumbers($(this));
24-
if (myCount != 3) {
24+
if ((myCount > 0) && (myCount != 3)) {
2525
$(this).crmError(ts('Your Bank Number requires three digits, use a leading "0" if necessary'));
2626
}
2727
switch($(this).val()) {
@@ -48,7 +48,7 @@ CRM.$(function ($) {
4848
});
4949
$('#cad_transit_number').blur(function(eventObj) {
5050
var myCount = onlyNumbers($(this));
51-
if (myCount != 5) {
51+
if ((myCount > 0) && (myCount != 5)) {
5252
$(this).crmError(ts('Your Bank Transit Number requires exactly five digits'));
5353
}
5454
iatsSetBankIdenficationNumber();

0 commit comments

Comments
 (0)