+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
static private $_singleton = NULL;
/**
- * Constructor
+ * Constructor.
*
* @param string $mode
* The mode of operation: live or test.
$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'] = 'Recurring Contribution';
$args['totalbillingcycles'] = $params['installments'];
$args['version'] = '56.0';
- $args['profilereference'] =
- "i={$params['invoiceID']}" .
+ $args['profilereference'] = "i={$params['invoiceID']}" .
"&m=$component" .
"&c={$params['contactID']}" .
"&r={$params['contributionRecurID']}" .
"&b={$params['contributionID']}" .
"&p={$params['contributionPageID']}";
+ // add CiviCRM BN code
+ $args['BUTTONSOURCE'] = 'CiviCRM_SP';
+
$result = $this->invokeAPI($args);
if (is_a($result, 'CRM_Core_Error')) {
}
/* Success */
-
$params['trxn_id'] = $result['transactionid'];
$params['gross_amount'] = $result['amt'];
$params['fee_amount'] = $result['feeamt'];
$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);
$args['billingfrequency'] = $params['frequency_interval'];
$args['method'] = "CreateRecurringPaymentsProfile";
$args['profilestartdate'] = $start_date;
- $args['desc'] =
+ $args['desc'] = "" .
$params['description'] . ": " .
$params['amount'] . " Per " .
$params['frequency_interval'] . " " .
$args['amt'] = $params['amount'];
$args['totalbillingcycles'] = $params['installments'];
$args['version'] = 56.0;
- $args['PROFILEREFERENCE'] =
+ $args['PROFILEREFERENCE'] = "" .
"i=" . $params['invoiceID'] . "&m=" . $component .
"&c=" . $params['contactID'] . "&r=" . $params['contributionRecurID'] .
"&b=" . $params['contributionID'] . "&p=" . $params['contributionPageID'];
}
/**
- * This function checks to see if we have the right config values
+ * This function checks to see if we have the right config values.
*
* @return string
* the error message if any
'invoice' => $params['invoiceID'],
'lc' => substr($config->lcMessages, -2),
'charset' => function_exists('mb_internal_encoding') ? mb_internal_encoding() : 'UTF-8',
- 'custom' => CRM_Utils_Array::value('accountingCode',
- $params
- ),
+ 'custom' => CRM_Utils_Array::value('accountingCode', $params),
+ 'bn' => 'CiviCRM_SP',
);
// add name and address if available, CRM-3130