return $errors;
}
- if (CRM_Utils_Array::value('payment_method', $fields) == NULL) {
- $errors['payment_method'] = ts('Payment Method is a required field.');
+ if (CRM_Utils_Array::value('payment_processor_id', $fields) == NULL) {
+ $errors['payment_processor_id'] = ts('Payment Method is a required field.');
}
else {
CRM_Core_Payment_Form::validatePaymentInstrument(
$form->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($form->_type, $form->_mode);
}
+ if (empty($form->_paymentProcessor)) {
+ // This would happen when hitting the back-button on a multi-page form with a $0 selection in play.
+ return;
+ }
$form->set('paymentProcessor', $form->_paymentProcessor);
$form->_paymentObject = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor);