if (empty($this->_paymentProcessor) && $paymentProcessorDetail['is_default'] == 1 || (count
($this->_paymentProcessors) == 1)
) {
- $this->_paymentProcessor = $processor;
+ $this->_paymentProcessor = $paymentProcessorDetail;
$this->assign('paymentProcessor', $this->_paymentProcessor);
}
}
}
}
+ /**
+ * Given a live processor ID get the test id.
+ *
+ * @param int $id
+ *
+ * @return int
+ * Test payment processor ID.
+ */
+ public static function getTestProcessorId($id) {
+ $liveProcessorName = civicrm_api3('payment_processor', 'getvalue', array(
+ 'id' => $id,
+ 'return' => 'name',
+ ));
+ return civicrm_api3('payment_processor', 'getvalue', array(
+ 'return' => 'id',
+ 'name' => $liveProcessorName,
+ 'domain_id' => CRM_Core_Config::domainID(),
+ ));
+ }
+
/**
* @param $paymentProcessorIDs
* @param $mode
}
/**
+ * Starting from the processor as an array retrieve the processor as an object.
+ *
+ * If there is no valid configuration it will not be retrieved.
+ *
* @param array $processor
+ *
+ * @return CRM_Core_Payment|NULL
+ *
* @throws \CRM_Core_Exception
*/
public function getByProcessor($processor) {