return $newCredit;
}
+ /* Return a static array of available billing modes, in the format:
+ * $array[numeric key] = 'descriptive text'.
+ */
+ static function getBillingModes() {
+ return array(
+ CRM_Core_Payment::BILLING_MODE_FORM => 'form',
+ CRM_Core_Payment::BILLING_MODE_BUTTON => 'button',
+ CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify',
+ );
+ }
}
*/
private static $activityType;
- /**
- * payment processor billing modes
- * @var array
- * @static
- */
- private static $billingMode;
-
/**
* states, provinces
* @var array
}
return self::$activityType[$index];
}
-
- /**
- * Get all payment-processor billing modes
- *
- * @access public
- * @static
- *
- * @return array ($id => $name)
- */
- public static function billingMode() {
- if (!self::$billingMode) {
- self::$billingMode = array(
- CRM_Core_Payment::BILLING_MODE_FORM => 'form',
- CRM_Core_Payment::BILLING_MODE_BUTTON => 'button',
- CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify',
- );
- }
- return self::$billingMode;
- }
/**
* Get all the State/Province from database.
}
/**
+ * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+ *
* Get all permissioned groups from database
*
* The static array group is returned, and if it's
if (isset($paymentProcessorType->billing_mode)) {
// ugh unidirectional manipulation
if (!is_numeric($paymentProcessorType->billing_mode)) {
- $billingModes = array_flip(CRM_Core_PseudoConstant::billingMode());
+ $billingModes = array_flip(CRM_Core_Payment::getBillingModes());
if (array_key_exists($paymentProcessorType->billing_mode, $billingModes)) {
$paymentProcessorType->billing_mode = $billingModes[$paymentProcessorType->billing_mode];
}
}
- if (!array_key_exists($paymentProcessorType->billing_mode, CRM_Core_PseudoConstant::billingMode())) {
+ if (!array_key_exists($paymentProcessorType->billing_mode, CRM_Core_Payment::getBillingModes())) {
throw new Exception("Unrecognized billing_mode");
}
}