protected $_paymentProcessor;
/**
- * Singleton function used to manage this object.
+ * Base url of the calling form.
*
- * We will migrate to calling Civi\Payment\System::singleton()->getByProcessor($paymentProcessor)
- * & Civi\Payment\System::singleton()->getById($paymentProcessor) directly as the main access methods & work
- * to remove this function all together
+ * This is used for processors that need to return the browser back to the CiviCRM site.
*
- * @param string $mode
- * The mode of operation: live or test.
- * @param array $paymentProcessor
- * The details of the payment processor being invoked.
- * @param object $paymentForm
- * Deprecated - avoid referring to this if possible. If you have to use it document why as this is scary interaction.
- * @param bool $force
- * Should we force a reload of this payment object.
+ * @var string
+ */
+ protected $baseReturnUrl;
+
+ /**
+ * Set Base return URL.
*
- * @return CRM_Core_Payment
- * @throws \CRM_Core_Exception
+ * @param string $url
+ * Url of site to return browser to.
*/
- public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- // make sure paymentProcessor is not empty
- // CRM-7424
- if (empty($paymentProcessor)) {
- return CRM_Core_DAO::$_nullObject;
- }
- //we use two lines because we can't remove the '&singleton' without risking breakage
- //of extension classes that extend this one
- $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
- return $object;
+ public function setBaseReturnUrl($url) {
+ $this->baseReturnUrl = $url;
+ }
+
+ /**
+ * Opportunity for the payment processor to override the entire form build.
+ *
+ * @param CRM_Core_Form $form
+ *
+ * @return bool
+ * Should form building stop at this point?
+ */
+ public function buildForm(&$form) {
+ return FALSE;
}
+ /**
+ * Opportunity for the payment processor to override the entire form build.
+ *
+ * @param CRM_Core_Form $form
+ *
+ * @return bool
+ * Should form building stop at this point?
+ */
+ public function buildForm(&$form) {
+ return FALSE;
+ }
+
/**
* Log payment notification message to forensic system log.
*