protected function handlePreApproval(&$params) {
try {
$payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
+ $params['component'] = 'contribute';
$result = $payment->doPreApproval($params);
}
catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
abstract class CRM_Core_Payment {
/**
- * How are we getting billing information?
+ * Component - ie. event or contribute.
+ *
+ * This is used for setting return urls.
+ *
+ * @var string
+ */
+ protected $_component;
+ /**
+ * How are we getting billing information.
+ *
+ * We are trying to completely deprecate these parameters.
*
* FORM - we collect it on the same page
* BUTTON - the processor collects it and sends it back to us via some protocol
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
public function doPayment(&$params, $component = 'contribute') {
+ $this->_component = $component;
$statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id');
if ($this->_paymentProcessor['billing_mode'] == 4) {
$result = $this->doTransferCheckout($params, $component);
* - redirect_url (if set the browser will be redirected to this.
*/
public function doPreApproval(&$params) {
+ $this->_component = $params['component'];
$token = $this->setExpressCheckOut($params);
return array(
'pre_approval_parameters' => array('token' => $token),
);
$params['invoiceID'] = $invoiceID;
+ $params['component'] = 'event';
$token = $payment->doPreApproval($params);
if (is_a($token, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($token);