From: kurund Date: Tue, 24 Feb 2015 14:59:57 +0000 (+0530) Subject: CRM-15993, added CiviCRM BN code and notice fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ebf695c349440b8195f8dac3bac5e6ff25f8e758;p=civicrm-core.git CRM-15993, added CiviCRM BN code and notice fixes ---------------------------------------- * CRM-15993: Add CiviCRM BN code to all PayPal methods for partner program tracking https://issues.civicrm.org/jira/browse/CRM-15993 --- diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 03748a2cc5..ddd35c8c79 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -193,7 +193,7 @@ class CRM_Contribute_BAO_Contribution_Utils { 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); } diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index cda8f4a58c..21a24f6dab 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -187,7 +187,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $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']; diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 867df555c8..3ad4b4ecd5 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -204,6 +204,9 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $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')) { @@ -332,6 +335,9 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $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);