Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused gross_amount. #332

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CRM/Core/Payment/Faps.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'];
Expand All @@ -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'];
Expand Down
13 changes: 6 additions & 7 deletions CRM/Core/Payment/FapsACH.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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',
));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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']);
Expand All @@ -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.
*
Expand All @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions CRM/Core/Payment/iATSService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions CRM/Core/Payment/iATSServiceACHEFT.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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,
Expand Down