You are here

function webform_civicrm_civicrm_alterPaymentProcessorParams in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 webform_civicrm.module \webform_civicrm_civicrm_alterPaymentProcessorParams()

Implements hook_civicrm_alterPaymentProcessorParams().

Legacy handling for paypal. We use it to override the return url so that the user gets redirected to the right place from paypal.

Remove when dropping support for CiviCRM 4.6 and below.

File

./webform_civicrm.module, line 586
Webform CiviCRM Integration Module: Links webform submissions to contacts in a CiviCRM database. @author Coleman Watts

Code

function webform_civicrm_civicrm_alterPaymentProcessorParams($paymentObj, $rawParams, &$cookedParams) {
  if (!empty($rawParams['webform_redirect_cancel']) && !empty($rawParams['webform_redirect_success']) && !empty($cookedParams['return']) && !empty($cookedParams['cancel_return'])) {
    $cookedParams['return'] = $rawParams['webform_redirect_success'];
    $cookedParams['cancel_return'] = $rawParams['webform_redirect_cancel'];
  }
}