+----------------------------------------------------------------------------+
| Licensed to CiviCRM under the Academic Free License version 3.0 |
| |
+----------------------------------------------------------------------------+
| Licensed to CiviCRM under the Academic Free License version 3.0 |
| |
- * @return void
- **********************************************************/ function __construct($mode, &$paymentProcessor) {
+ * @param $paymentProcessor
+ *
+ * @return \CRM_Core_Payment_Elavon *******************************************************
+ */
+ function __construct($mode, &$paymentProcessor) {
*/
static function &singleton($mode, &$paymentProcessor) {
$processorName = $paymentProcessor['name'];
*/
static function &singleton($mode, &$paymentProcessor) {
$processorName = $paymentProcessor['name'];
// contact name
$requestFields['ssl_ship_to_last_name'] = $params['last_name'];
$requestFields['ssl_card_number'] = $params['credit_card_number'];
// contact name
$requestFields['ssl_ship_to_last_name'] = $params['last_name'];
$requestFields['ssl_card_number'] = $params['credit_card_number'];
$requestFields['ssl_exp_date'] = sprintf('%02d', (int) $params['month']) . substr($params['year'], 2, 2);;
$requestFields['ssl_cvv2cvc2'] = $params['cvv2'];
// CVV field passed to processor
$requestFields['ssl_exp_date'] = sprintf('%02d', (int) $params['month']) . substr($params['year'], 2, 2);;
$requestFields['ssl_cvv2cvc2'] = $params['cvv2'];
// CVV field passed to processor
$requestFields['ssl_transaction_type'] = "CCSALE";
$requestFields['ssl_description'] = empty($params['description']) ? "backoffice payment" : $params['description'];
$requestFields['ssl_customer_number'] = substr($params['credit_card_number'], -4);
$requestFields['ssl_transaction_type'] = "CCSALE";
$requestFields['ssl_description'] = empty($params['description']) ? "backoffice payment" : $params['description'];
$requestFields['ssl_customer_number'] = substr($params['credit_card_number'], -4);
/************************************************************************************
* Fields available from civiCRM not implemented for Elavon
/************************************************************************************
* Fields available from civiCRM not implemented for Elavon
$requestFields['ssl_pin'] = $this->_paymentProcessor['signature'];
$host = $this->_paymentProcessor['url_site'];
$requestFields['ssl_pin'] = $this->_paymentProcessor['signature'];
$host = $this->_paymentProcessor['url_site'];
// set this for debugging -look for output in apache error log
//curl_setopt ($ch,CURLOPT_VERBOSE,1 );
// ensures any Location headers are followed
// set this for debugging -look for output in apache error log
//curl_setopt ($ch,CURLOPT_VERBOSE,1 );
// ensures any Location headers are followed
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+ if (ini_get('open_basedir') == '' && ini_get('safe_mode') == 'Off') {
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+ }
* NOTE: Called by Events and Contribute to check config params are set prior to trying
* register any credit card details
*
* NOTE: Called by Events and Contribute to check config params are set prior to trying
* register any credit card details
*
$xmlFieldLength['ssl_transaction_type'] = 20;
$xmlFieldLength['ssl_description'] = 255;
$xmlFieldLength['ssl_merchant_id'] = 15;
$xmlFieldLength['ssl_transaction_type'] = 20;
$xmlFieldLength['ssl_description'] = 255;
$xmlFieldLength['ssl_merchant_id'] = 15;
$xml = '<txn>';
foreach ($requestFields as $key => $value) {
$xml .= '<' . $key . '>' . self::tidyStringforXML($value, $xmlFieldLength[$key]) . '</' . $key . '>';
$xml = '<txn>';
foreach ($requestFields as $key => $value) {
$xml .= '<' . $key . '>' . self::tidyStringforXML($value, $xmlFieldLength[$key]) . '</' . $key . '>';
function tidyStringforXML($value, $fieldlength) {
// the xml is posted to a url so must not contain spaces etc. It also needs to be cut off at a certain
// length to match the processor's field length. The cut needs to be made after spaces etc are
function tidyStringforXML($value, $fieldlength) {
// the xml is posted to a url so must not contain spaces etc. It also needs to be cut off at a certain
// length to match the processor's field length. The cut needs to be made after spaces etc are