public function doPayment(&$params, $component = 'contribute') {
$propertyBag = \Civi\Payment\PropertyBag::cast($params);
$this->_component = $component;
- $statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'validate');
+ $result = $this->setStatusPaymentPending([]);
// If we have a $0 amount, skip call to processor and set payment_status to Completed.
// Conceivably a processor might override this - perhaps for setting up a token - but we don't
// have an example of that at the moment.
if ($propertyBag->getAmount() == 0) {
- $result['payment_status_id'] = array_search('Completed', $statuses);
- $result['payment_status'] = 'Completed';
+ $result = $this->setStatusPaymentCompleted($result);
return $result;
}
$beaglestatus = ': ' . $beaglestatus;
}
$params['trxn_result_code'] = $eWAYResponse->Status() . $beaglestatus;
- $params['trxn_id'] = $eWAYResponse->TransactionNumber();
- $params['payment_status_id'] = array_search('Completed', $statuses);
- $params['payment_status'] = 'Completed';
-
- return $params;
+ $result['trxn_id'] = $eWAYResponse->TransactionNumber();
+ $result = $this->setStatusPaymentCompleted($result);
+ return $result;
}
/**