elseif ($form->_contributeMode == 'express') {
if ($form->_values['is_monetary'] && $form->_amount > 0.0) {
// determine if express + recurring and direct accordingly
- if ($paymentParams['is_recur'] == 1) {
+ if (!empty($paymentParams['is_recur']) && $paymentParams['is_recur'] == 1) {
if (is_object($payment)) {
$result = $payment->createRecurringPayments($paymentParams);
}
$payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);
$expressParams = $payment->getExpressCheckoutDetails($this->get('token'));
- $this->_params['payer'] = $expressParams['payer'];
+ $this->_params['payer'] = CRM_Utils_Array::value('payer', $expressParams);
$this->_params['payer_id'] = $expressParams['payer_id'];
$this->_params['payer_status'] = $expressParams['payer_status'];
$args['cancelURL'] = CRM_Utils_Array::value('cancelURL', $params);
$args['desc'] = $params['description'];
+ // add CiviCRM BN code
+ $args['BUTTONSOURCE'] = 'CiviCRM_SP';
+
$result = $this->invokeAPI($args);
if (is_a($result, 'CRM_Core_Error')) {
$args['desc'] = substr(CRM_Utils_Array::value('description', $params), 0, 127);
$args['custom'] = CRM_Utils_Array::value('accountingCode', $params);
+ // add CiviCRM BN code
+ $args['BUTTONSOURCE'] = 'CiviCRM_SP';
+
if (CRM_Utils_Array::value('is_recur', $params) == 1) {
$start_time = strtotime(date('m/d/Y'));
$start_date = date('Y-m-d\T00:00:00\Z', $start_time);