else {
$contributionParams['financial_type_id'] = $templateContribution['financial_type_id'];
}
- $contributionParams['contact_id'] = $templateContribution['contact_id'];
- $contributionParams['source'] = empty($templateContribution['source']) ? ts('Recurring contribution') : $templateContribution['source'];
+ foreach (['contact_id', 'currency', 'source'] as $fieldName) {
+ $contributionParams[$fieldName] = $templateContribution[$fieldName];
+ }
+
+ $contributionParams['source'] = $contributionParams['source'] ?: ts('Recurring contribution');
//CRM-18805 -- Contribution page not recorded on recurring transactions, Recurring contribution payments
//do not create CC or BCC emails or profile notifications.
], 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.
'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',
'contribution_recur_id' => $contributionRecur['id'],
]);
$this->assertEquals('Template Contribution', $repeatContribution['values'][$repeatContribution['id']]['source']);
+ $this->assertEquals('AUD', $repeatContribution['values'][$repeatContribution['id']]['currency']);
}
/**