/**
* Add payment fields are depending on payment processor
*
- * @param CRM_Contribute_Form_Contribution $form
+ * @param CRM_Contribute_Form_Contribution| CRM_Contribute_Form_Contribution_Main $form
* @todo - add other forms specifically to the definition - since we don't have for $form - since we aren't adding the property to
* CRM_Core_Form (don't suppose we should?)
* @param array $processor array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors
//checks after setting $form->_paymentProcessor
// we do this outside of the above conditional to avoid
// saving the country/state list in the session (which could be huge)
+ CRM_Core_Payment_Form::setPaymentFieldsByProcessor($form, $form->_paymentProcessor);
- if (($form->_paymentProcessor['billing_mode'] & CRM_Core_Payment::BILLING_MODE_FORM) && !empty($form->_values['is_monetary'])) {
- CRM_Core_Payment_Form::setPaymentFieldsByType($form->_paymentProcessor['payment_type'], $form);
- }
$form->assign_by_ref('paymentProcessor', $form->_paymentProcessor);
$fields = array(
'id', 'name', 'payment_processor_type_id', 'user_name', 'password',
'signature', 'url_site', 'url_api', 'url_recur', 'url_button',
- 'subject', 'class_name', 'is_recur', 'billing_mode',
+ 'subject', 'class_name', 'is_recur', 'billing_mode', 'is_test',
'payment_type', 'is_default',
);
$result = array();
}
$result['payment_processor_type'] = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $dao->payment_processor_type_id, 'name');
- $result['instance'] =& CRM_Core_Payment::singleton($mode, $result);
+ $result['instance'] = $result['object'] =& CRM_Core_Payment::singleton($mode, $result);
return $result;
}