'id' => $type,
);
- CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE);
+ CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE);
$qfKey = $this->controller->_key;
$this->assign('qfKey', $qfKey);
);
$this->add('select', 'payment_instrument_id',
- ts('Paid By'),
+ ts('Payment Method'),
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(),
TRUE, array('onChange' => "return showHideByValue('payment_instrument_id','4','checkNumber','table-row','select',false);")
);
$this->add('textarea', 'receipt_text', ts('Confirmation Message'));
// add various dates
- $dateLabel = ($this->_refund) ? ts('Refund Date') : ts('Received Date');
+ $dateLabel = ($this->_refund) ? ts('Refund Date') : ts('Date Received');
$this->addDateTime('trxn_date', $dateLabel, FALSE, array('formatType' => 'activityDateTime'));
if ($this->_contactId && $this->_id) {
$result = NULL;
if ($paymentParams['amount'] > 0.0) {
- // force a reget of the payment processor in case the form changed it, CRM-7179
- $payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this, TRUE);
- $result = $payment->doDirectPayment($paymentParams);
- }
-
- if (is_a($result, 'CRM_Core_Error')) {
- //set the contribution mode.
- $urlParams = "action=add&cid={$this->_contactId}&id={$this->_id}&component={$this->_component}";
- if ($this->_mode) {
- $urlParams .= "&mode={$this->_mode}";
+ try {
+ // force a reget of the payment processor in case the form changed it, CRM-7179
+ $payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
+ $result = $payment->doPayment($paymentParams);
+ }
+ catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
+ //set the contribution mode.
+ $urlParams = "action=add&cid={$this->_contactId}&id={$this->_id}&component={$this->_component}";
+ if ($this->_mode) {
+ $urlParams .= "&mode={$this->_mode}";
+ }
+ CRM_Core_Error::displaySessionError($result);
+ CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/payment/add', $urlParams));
}
- CRM_Core_Error::displaySessionError($result);
- CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/payment/add', $urlParams));
}
if ($result) {