protected $_mode = NULL;
- protected $_params = array();
+ protected $_params = [];
/**
* We only need one instance of this object. So we use the singleton
return self::error(9002, ts('Could not initiate connection to payment gateway'));
}
- curl_setopt($submit, CURLOPT_HTTPHEADER, array('SOAPAction: ""'));
+ curl_setopt($submit, CURLOPT_HTTPHEADER, ['SOAPAction: ""']);
curl_setopt($submit, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($submit, CURLOPT_TIMEOUT, 60);
curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
// FIXME: We are using the trxn_result_code column to store all these extra details since there
// seems to be nowhere else to put them. This is THE WRONG THING TO DO!
- $extras = array(
+ $extras = [
'authcode' => $response['AUTHCODE'],
'batch_id' => $response['BATCHID'],
'message' => $response['MESSAGE'],
'trxn_result_code' => $response['RESULT'],
- );
+ ];
$params['trxn_id'] = $response['PASREF'];
$params['trxn_result_code'] = serialize($extras);
* An array of the result with following keys:
*/
public function xml_parse_into_assoc($xml) {
- $input = array();
- $result = array();
+ $input = [];
+ $result = [];
$result['#error'] = FALSE;
$result['#return'] = NULL;
}
else {
$result['#error'] = ts('Error parsing XML result - error code = %1 at line %2 char %3',
- array(
+ [
1 => xml_get_error_code($xmlparser),
2 => xml_get_current_line_number($xmlparser),
3 => xml_get_current_column_number($xmlparser),
- )
+ ]
);
}
}
* @return array
*/
public function _xml_parse($input, $depth = 1) {
- $output = array();
- $children = array();
+ $output = [];
+ $children = [];
foreach ($input as $data) {
if ($data['level'] == $depth) {
break;
case 'open':
- $children = array();
+ $children = [];
break;
case 'close':
* the error message if any
*/
public function checkConfig() {
- $error = array();
+ $error = [];
if (empty($this->_paymentProcessor['user_name'])) {
$error[] = ts('Merchant ID is not set for this payment processor');
}