Skip to content

Commit

Permalink
Merge pull request civicrm#12999 from mlutfy/translation15
Browse files Browse the repository at this point in the history
dev/translation#15 Fix backend CC contributions left pending if statuses are localised
  • Loading branch information
eileenmcnaughton authored Oct 24, 2018
2 parents 5143ab6 + 003e934 commit 331a021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ protected function processCreditCard($submittedValues, $lineItem, $contactID) {
// NOTE - I expect this is obsolete.
$payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
try {
$statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id');
$completeStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
$result = $payment->doPayment($paymentParams, 'contribute');
$this->assign('trxn_id', $result['trxn_id']);
$contribution->trxn_id = $result['trxn_id'];
Expand All @@ -1170,7 +1170,7 @@ protected function processCreditCard($submittedValues, $lineItem, $contactID) {
* as historically we have had to guess from the context - ie doDirectPayment
* = error or success, unless it is a recurring contribution in which case it is pending.
*/
if ($result['payment_status_id'] == array_search('Completed', $statuses)) {
if ($result['payment_status_id'] == $completeStatusId) {
try {
civicrm_api3('contribution', 'completetransaction', array(
'id' => $contribution->id,
Expand Down

0 comments on commit 331a021

Please sign in to comment.