Skip to content
Snippets Groups Projects
Closed Backend credit card contribution are left as Pending if contribution statuses are localized
  • View options
  • Backend credit card contribution are left as Pending if contribution statuses are localized

  • View options
  • Closed Issue created by bgm

    How to reproduce:

    contribution-pending-status-complete

    If I change the contribution status back to 'Complete', it works as expected.

    I suspect the culprit is here:
    https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution.php#L1181

    The $statuses are fetched using:

            $statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id');

    PS: the front-end form uses a hardcoded value:

      protected function completeTransaction($result, $contributionID) {
        if (CRM_Utils_Array::value('payment_status_id', $result) == 1) {
          try {
            civicrm_api3('contribution', 'completetransaction', array(
              'id' => $contributionID,
              'trxn_id' => CRM_Utils_Array::value('trxn_id', $result),
              'payment_processor_id' => $this->_paymentProcessor['id'],
              'is_transactional' => FALSE,
              'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
              'receive_date' => CRM_Utils_Array::value('receive_date', $result),
              'card_type_id' => CRM_Utils_Array::value('card_type_id', $result),
              'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $result),
            ));
          }
          catch (CiviCRM_API3_Exception $e) {
            if ($e->getErrorCode() != 'contribution_completed') {
              throw new CRM_Core_Exception('Failed to update contribution in database');
            }
          }
        }
      }

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading