return '';
}
+ /**
+ * Get the title of the payment processor to display to the user
+ *
+ * @return string
+ */
+ public function getTitle() {
+ return $this->getPaymentProcessor()['title'] ?? $this->getPaymentProcessor()['name'];
+ }
+
/**
* Getter for accessing member vars.
*
$pps = [];
if (!empty($this->_paymentProcessors)) {
foreach ($this->_paymentProcessors as $key => $processor) {
- $pps[$key] = $processor['title'] ?? $processor['name'];
+ $pps[$key] = $this->getPaymentProcessorTitle($processor);
}
}
if ($this->getPayLaterLabel()) {
return $pps;
}
+ /**
+ * Get the title of the payment processor to display to the user
+ * Note: There is an identical function in CRM_Core_Payment
+ *
+ * @param array $processor
+ *
+ * @return string
+ */
+ protected function getPaymentProcessorTitle($processor) {
+ return $processor['title'] ?? $processor['name'];
+ }
+
/**
* Adds in either a set of radio buttons or hidden fields to contain the payment processors on a front end form
*/