From 154ac64eca4093ce7b49cd34326c625f0419db4e Mon Sep 17 00:00:00 2001 From: KarinG Date: Sat, 19 Sep 2020 15:38:00 -0600 Subject: [PATCH] Remove unused gross_amount. --- CRM/Core/Payment/Faps.php | 5 ++--- CRM/Core/Payment/FapsACH.php | 13 ++++++------- CRM/Core/Payment/iATSService.php | 2 -- CRM/Core/Payment/iATSServiceACHEFT.php | 2 -- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CRM/Core/Payment/Faps.php b/CRM/Core/Payment/Faps.php index 01684a62..e5e64549 100644 --- a/CRM/Core/Payment/Faps.php +++ b/CRM/Core/Payment/Faps.php @@ -377,7 +377,6 @@ public function doPayment(&$params, $component = 'contribute') { // For versions >= 4.6.6, the proper key. $params['payment_status_id'] = 1; $params['trxn_id'] = trim($result['data']['referenceNumber']).':'.time(); - $params['gross_amount'] = $params['amount']; return $params; } else { @@ -439,7 +438,7 @@ protected function convertParams($params, $method) { $result = civicrm_api3('Country', 'get', [ 'sequential' => 1, 'return' => ['name'], - 'id' => $params['country_id'], + 'id' => $params['country_id'], 'options' => ['limit' => 1], ]); $params['country'] = $result['values'][0]['name']; @@ -453,7 +452,7 @@ protected function convertParams($params, $method) { $result = civicrm_api3('StateProvince', 'get', [ 'sequential' => 1, 'return' => ['name'], - 'id' => $params['state_province_id'], + 'id' => $params['state_province_id'], 'options' => ['limit' => 1], ]); $params['state_province'] = $result['values'][0]['name']; diff --git a/CRM/Core/Payment/FapsACH.php b/CRM/Core/Payment/FapsACH.php index 2c3bed7d..d16e557b 100644 --- a/CRM/Core/Payment/FapsACH.php +++ b/CRM/Core/Payment/FapsACH.php @@ -37,7 +37,7 @@ function __construct( $mode, &$paymentProcessor ) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->disable_cryptogram = iats_get_setting('disable_cryptogram'); - $this->is_test = ($this->_mode == 'test' ? 1 : 0); + $this->is_test = ($this->_mode == 'test' ? 1 : 0); } /** @@ -104,11 +104,11 @@ public function buildForm(&$form) { )); // and now add in a helpful cheque image and description switch($currency) { - case 'USD': + case 'USD': CRM_Core_Region::instance('billing-block')->add(array( 'template' => 'CRM/Iats/BillingBlockFapsACH_USD.tpl', )); - case 'CAD': + case 'CAD': CRM_Core_Region::instance('billing-block')->add(array( 'template' => 'CRM/Iats/BillingBlockFapsACH_CAD.tpl', )); @@ -151,7 +151,7 @@ public function doPayment(&$params, $component = 'contribute') { ); $vault_request = new CRM_Iats_FapsRequest($options); $request = $this->convertParams($params, $options['action']); - // auto-generate a compliant vault key + // auto-generate a compliant vault key $vault_key = self::generateVaultKey($request['ownerEmail']); $request['vaultKey'] = $vault_key; $request['ipAddress'] = $ipAddress; @@ -216,7 +216,6 @@ public function doPayment(&$params, $component = 'contribute') { if ($success) { $params['payment_status_id'] = 2; $params['trxn_id'] = trim($result['data']['referenceNumber']).':'.time(); - $params['gross_amount'] = $params['amount']; // Core assumes that a pending result will have no transaction id, but we have a useful one. if (!empty($params['contributionID'])) { $contribution_update = array('id' => $params['contributionID'], 'trxn_id' => $params['trxn_id']); @@ -237,7 +236,7 @@ public function doPayment(&$params, $component = 'contribute') { } /** - * Get the category text. + * Get the category text. * Before I return it, check that the category text exists, and create it if * it doesn't. * @@ -257,7 +256,7 @@ public static function getCategoryText($credentials, $is_test, $ipAddress = NULL static $ach_category_text_saved; if (!empty($ach_category_text_saved)) { return $ach_category_text_saved; - } + } $ach_category_text = iats_get_setting('ach_category_text'); $ach_category_text = empty($ach_category_text) ? FAPS_DEFAULT_ACH_CATEGORY_TEXT : $ach_category_text; $ach_category_exists = FALSE; diff --git a/CRM/Core/Payment/iATSService.php b/CRM/Core/Payment/iATSService.php index 149b670d..94d8cf54 100644 --- a/CRM/Core/Payment/iATSService.php +++ b/CRM/Core/Payment/iATSService.php @@ -155,7 +155,6 @@ public function doPayment(&$params, $component = 'contribute') { // Success. $params['payment_status_id'] = 1; $params['trxn_id'] = trim($result['remote_id']) . ':' . time(); - $params['gross_amount'] = $params['amount']; return $params; } else { @@ -244,7 +243,6 @@ public function doPayment(&$params, $component = 'contribute') { // uniqueness and provide helpful referencing. $update = array( 'trxn_id' => trim($result['remote_id']) . ':' . time(), - 'gross_amount' => $params['amount'], 'payment_status_id' => 1, ); // do some cleanups to the recurring record in updateRecurring diff --git a/CRM/Core/Payment/iATSServiceACHEFT.php b/CRM/Core/Payment/iATSServiceACHEFT.php index e9b5f631..fb15c453 100644 --- a/CRM/Core/Payment/iATSServiceACHEFT.php +++ b/CRM/Core/Payment/iATSServiceACHEFT.php @@ -226,7 +226,6 @@ public function doPayment(&$params, $component = 'contribute') { if ($result['status']) { $params['payment_status_id'] = 2; $params['trxn_id'] = trim($result['remote_id']) . ':' . time(); - $params['gross_amount'] = $params['amount']; // Core assumes that a pending result will have no transaction id, but we have a useful one. if (!empty($params['contributionID'])) { $contribution_update = array('id' => $params['contributionID'], 'trxn_id' => $params['trxn_id']); @@ -325,7 +324,6 @@ public function doPayment(&$params, $component = 'contribute') { // Add a time string to iATS short authentication string to ensure uniqueness and provide helpful referencing. $update = array( 'trxn_id' => trim($result['remote_id']) . ':' . time(), - 'gross_amount' => $params['amount'], 'payment_status_id' => 2, ); // Setting the next_sched_contribution_date param doesn't do anything,