* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Financial_DAO_PaymentProcessor object on success, null otherwise
- * @static
+ * @return CRM_Financial_DAO_PaymentProcessor|null
+ * object on success, null otherwise
*/
public static function retrieve(&$params, &$defaults) {
$paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
* @param bool $is_active
* Value we want to set the is_active field.
*
- * @return Object
- * DAO object on sucess, null otherwise
+ * @return CRM_Financial_DAO_PaymentProcessor|null
+ * DAO object on success, null otherwise
*
- * @static
*/
public static function setIsActive($id, $is_active) {
return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_PaymentProcessor', $id, 'is_active', $is_active);
*
* @param NULL
*
- * @return object
+ * @return CRM_Financial_DAO_PaymentProcessor|null
* The default payment processor object on success,
- * null otherwise
- * @static
+ * null otherwise
*/
public static function &getDefault() {
if (self::$_defaultPaymentProcessor == NULL) {
}
/**
- * Function to delete payment processor
+ * Delete payment processor
*
* @param int $paymentProcessorID
*
* @return null
- * @static
*/
public static function del($paymentProcessorID) {
if (!$paymentProcessorID) {
*
* @return array
* associated array with payment processor related fields
- * @static
*/
public static function getPayment($paymentProcessorID, $mode) {
if (!$paymentProcessorID) {
CRM_Core_Error::fatal(ts('Invalid value passed to getPayment function'));
}
- $dao = new CRM_Financial_DAO_PaymentProcessor();
- $dao->id = $paymentProcessorID;
+ $dao = new CRM_Financial_DAO_PaymentProcessor();
+ $dao->id = $paymentProcessorID;
$dao->is_active = 1;
if (!$dao->find(TRUE)) {
return NULL;
if ($mode == 'test') {
$testDAO = new CRM_Financial_DAO_PaymentProcessor();
- $testDAO->name = $dao->name;
+ $testDAO->name = $dao->name;
$testDAO->is_active = 1;
- $testDAO->is_test = 1;
+ $testDAO->is_test = 1;
if (!$testDAO->find(TRUE)) {
CRM_Core_Error::fatal(ts('Could not retrieve payment processor details'));
}
* Compare 2 payment processors to see which should go first based on is_default
* (sort function for sortDefaultFirst)
* @param array $processor1
- * @param array_type $processor2
+ * @param array $processor2
* @return number
*/
public static function defaultComparison($processor1, $processor2) {
*
* @return array
* associated array with payment processor related fields
- * @static
*/
public static function buildPayment($dao, $mode) {
$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', 'is_test',
- 'payment_type', 'is_default',
+ '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',
+ 'is_test',
+ 'payment_type',
+ 'is_default',
);
$result = array();
foreach ($fields as $name) {
* @return array
*/
public static function getAllPaymentProcessors($mode, $reset = FALSE) {
- /**
- * $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($mode ? 'test' : 'all');
- if (!$reset) {
- $processors = CRM_Utils_Cache::singleton()->get($cacheKey);
- if (!empty($processors)) {
- return $processors;
- }
- }
- * */
- $retrievalParameters = array('is_active' => TRUE, 'options' => array('sort' => 'is_default DESC, name'), 'api.payment_processor_type.getsingle' => 1);
+ /*
+ * $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($mode ? 'test' : 'all');
+ * if (!$reset) {
+ * $processors = CRM_Utils_Cache::singleton()->get($cacheKey);
+ * if (!empty($processors)) {
+ * return $processors;
+ * }
+ * }
+ */
+ $retrievalParameters = array(
+ 'is_active' => TRUE,
+ 'options' => array('sort' => 'is_default DESC, name'),
+ 'api.payment_processor_type.getsingle' => 1
+ );
if ($mode == 'test') {
$retrievalParameters['is_test'] = 1;
}
* arguably this could go on the pseudoconstant class
*
* @param array $capabilities
- * capabilities of processor e.g
- * - BackOffice
- * - TestMode
- * - LiveMode
- * - FutureStartDate
- * include test processors (we want to phase this out in favour of the testMode Capability)
+ * capabilities of processor e.g
+ * - BackOffice
+ * - TestMode
+ * - LiveMode
+ * - FutureStartDate
*
* @param array $ids
*
* @param string $type
* Type of payment information to be retrieved.
*
- * @return int
- * / array / object based on type
- * @static
+ * @return int|array|object
*/
public static function getProcessorForEntity($entityID, $component = 'contribute', $type = 'id') {
$result = NULL;
if (!in_array($component, array(
- 'membership', 'contribute', 'recur'))) {
+ 'membership',
+ 'contribute',
+ 'recur'
+ ))
+ ) {
return $result;
}
//FIXME: