Skip to content

Commit

Permalink
[REF] remove first attempt to set currency in repeattransaction flow
Browse files Browse the repository at this point in the history
The currency is retrieved from the template transaction, these lines are no longer needed, as demonstrated
in the test
  • Loading branch information
eileenmcnaughton committed Aug 4, 2020
1 parent 5d5e5ad commit 6df8cef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4462,11 +4462,6 @@ public static function completeOrder($input, &$ids, $objects, $isPostPaymentCrea
], array_intersect_key($input, array_fill_keys($inputContributionWhiteList, 1)
));

// CRM-20678 Ensure that the currency is correct in subseqent transcations.
if (empty($contributionParams['currency']) && isset($objects['first_contribution']->currency)) {
$contributionParams['currency'] = $objects['first_contribution']->currency;
}

$contributionParams['payment_processor'] = $input['payment_processor'] = $paymentProcessorId;

// If paymentProcessor is not set then the payment_instrument_id would not be correct.
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function testGetTemplateContributionNewTemplate() {
'financial_type_id' => 1,
'source' => 'Template Contribution',
'payment_instrument_id' => 1,
'currency' => 'USD',
'currency' => 'AUD',
'contact_id' => $this->individualCreate(),
'contribution_status_id' => 1,
'receive_date' => 'yesterday',
Expand Down

0 comments on commit 6df8cef

Please sign in to comment.