3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | This file is a part of CiviCRM. |
8 | CiviCRM is free software; you can copy, modify, and distribute it |
9 | under the terms of the GNU Affero General Public License |
10 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | CiviCRM is distributed in the hope that it will be useful, but |
13 | WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
15 | See the GNU Affero General Public License for more details. |
17 | You should have received a copy of the GNU Affero General Public |
18 | License and the CiviCRM Licensing Exception along |
19 | with this program; if not, contact CiviCRM LLC |
20 | at info[AT]civicrm[DOT]org. If you have questions about the |
21 | GNU Affero General Public License or the licensing of CiviCRM, |
22 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
23 +--------------------------------------------------------------------+
28 * PxPay Functionality Copyright (C) 2008 Lucas Baker, Logistic Information Systems Limited (Logis)
29 * PxAccess Functionality Copyright (C) 2008 Eileen McNaughton
30 * Licensed to CiviCRM under the Academic Free License version 3.0.
32 * Grateful acknowledgements go to Donald Lobo for invaluable assistance
33 * in creating this payment processor module
37 * Class CRM_Core_Payment_PaymentExpressUtils
39 class CRM_Core_Payment_PaymentExpressUtils
{
47 static function _valueXml($element, $value = NULL) {
50 if (is_array($element)) {
52 foreach ($element as $elem => $value) {
53 $xml .= self
::_valueXml($elem, $value);
57 return "<" . $element . ">" . $value . "</" . $element . ">" . $nl;
66 static function _xmlElement($xml, $name) {
67 $value = preg_replace('/.*<' . $name . '[^>]*>(.*)<\/' . $name . '>.*/', '\1', $xml);
77 static function _xmlAttribute($xml, $name) {
78 $value = preg_replace('/<.*' . $name . '="([^"]*)".*>/', '\1', $xml);
79 return $value != $xml ?
$value : NULL;
88 static function &_initCURL($query, $url) {
91 curl_setopt($curl, CURLOPT_URL
, $url);
92 curl_setopt($curl, CURLOPT_FRESH_CONNECT
, TRUE);
93 curl_setopt($curl, CURLOPT_POST
, TRUE);
94 curl_setopt($curl, CURLOPT_POSTFIELDS
, $query);
95 curl_setopt($curl, CURLOPT_TIMEOUT
, 30);
96 curl_setopt($curl, CURLOPT_RETURNTRANSFER
, TRUE);
97 if (ini_get('open_basedir') == '' && ini_get('safe_mode') == 'Off') {
98 curl_setopt($curl, CURLOPT_FOLLOWLOCATION
, FALSE);
100 curl_setopt($curl, CURLOPT_HEADER
, 0);
101 curl_setopt($curl, CURLOPT_SSLVERSION
, 0);
103 if (strtoupper(substr(@php_uname
('s'), 0, 3)) === 'WIN') {
104 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER
, CRM_Core_BAO_Setting
::getItem(CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
, 'verifySSL'));
105 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST
, CRM_Core_BAO_Setting
::getItem(CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
, 'verifySSL') ?
2 : 0);