<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* Note that this code is written to accommodate the possibility CiviCRM will switch to implementing pay later as a manual processor in future
*
* @param CRM_Contribute_Form_AbstractEditPayment|CRM_Contribute_Form_Contribution_Main $form
- * @param array $processor array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors
- * @param bool $forceBillingFieldsForPayLater display billing fields even for pay later
+ * @param array $processor
+ * Array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors.
+ * @param bool $forceBillingFieldsForPayLater
+ * Display billing fields even for pay later.
*/
static public function setPaymentFieldsByProcessor(&$form, $processor, $forceBillingFieldsForPayLater = FALSE) {
$form->billingFieldSets = array();
* @param CRM_Core_Form $form
*
* @return void
- * @access protected
*/
static protected function setBillingDetailsFields(&$form) {
$bltID = $form->_bltID;
*
* @return array
*/
- static function getPaymentFields($paymentProcessor) {
+ public static function getPaymentFields($paymentProcessor) {
$paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor);
return $paymentProcessorObject->getPaymentFormFields();
}
*
* @return array
*/
- static function getPaymentFieldMetadata($paymentProcessor) {
+ public static function getPaymentFieldMetadata($paymentProcessor) {
$paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor);
return $paymentProcessorObject->getPaymentFormFieldsMetadata();
}
*
* @return string
*/
- static function getPaymentTypeName($paymentProcessor) {
+ public static function getPaymentTypeName($paymentProcessor) {
$paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor);
return $paymentProcessorObject->getPaymentTypeName();
}
*
* @return string
*/
- static function getPaymentTypeLabel($paymentProcessor) {
+ public static function getPaymentTypeLabel($paymentProcessor) {
$paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor);
return ts(($paymentProcessorObject->getPaymentTypeLabel()) . ' Information');
}
/**
* @param CRM_Contribute_Form_AbstractEditPayment|CRM_Contribute_Form_Contribution_Main|CRM_Core_Payment_ProcessorForm|CRM_Contribute_Form_UpdateBilling $form
- * @param array $processor array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors
- * @param bool $isBillingDataOptional This manifests for 'NULL' (pay later) payment processor as the addition of billing fields to the form and
+ * @param array $processor
+ * Array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors.
+ * @param bool $isBillingDataOptional
+ * This manifests for 'NULL' (pay later) payment processor as the addition of billing fields to the form and.
* for payment processors that gather payment data on site as rendering the fields as not being required. (not entirely sure why but this
* is implemented for back office forms)
*
* @return bool
*/
- static function buildPaymentForm($form, $processor, $isBillingDataOptional){
+ public static function buildPaymentForm($form, $processor, $isBillingDataOptional) {
//if the form has address fields assign to the template so the js can decide what billing fields to show
$profileAddressFields = $form->get('profileAddressFields');
if (!empty($profileAddressFields)) {
/**
* @param CRM_Core_Form $form
- * @param array $paymentFields array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors
+ * @param array $paymentFields
+ * Array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors.
* @param $paymentFields
*/
* The credit card pseudo constant results only the CC label, not the key ID
* So we normalize the name to use it as a CSS class.
*/
- static function getCreditCardCSSNames() {
+ public static function getCreditCardCSSNames() {
$creditCardTypes = array();
foreach (CRM_Contribute_PseudoConstant::creditCard() as $key => $name) {
// Replace anything not css-friendly by an underscore
* Make sure that credit card number and cvv are valid
* Called within the scope of a QF formRule function
*/
- static function validateCreditCard($values, &$errors) {
+ public static function validateCreditCard($values, &$errors) {
if (!empty($values['credit_card_type'])) {
if (!empty($values['credit_card_number']) &&
!CRM_Utils_Rule::creditCardNumber($values['credit_card_number'], $values['credit_card_type'])
* @return void
* @static
*/
- static function mapParams($id, &$src, &$dst, $reverse = FALSE) {
+ public static function mapParams($id, &$src, &$dst, $reverse = FALSE) {
static $map = NULL;
if (!$map) {
$map = array(
* @return int
* @static
*/
- static function getCreditCardExpirationMonth($src) {
+ public static function getCreditCardExpirationMonth($src) {
if ($month = CRM_Utils_Array::value('M', $src['credit_card_exp_date'])) {
return $month;
}
* @return int
* @static
*/
- static function getCreditCardExpirationYear($src) {
+ public static function getCreditCardExpirationYear($src) {
return CRM_Utils_Array::value('Y', $src['credit_card_exp_date']);
}
}