Exemplo n.º 1
0
function ch_AmeriNet_refund($transInfo, $bankInfo, $companyInfo)
{
    global $etel_fraud_limit;
    require_once "SOAP/Client.php";
    require_once "subFunctions/banks.amerinet.php";
    $response = "";
    $response['errormsg'] = "Transaction could not be processed.";
    if ($bankInfo['bk_ch_support'] != 1) {
        $response['errormsg'] = "This bank does not support this Integration Function. Please contact an administrator.";
        return $response;
    }
    $processor = new AmeriNet_Client($bankInfo, $transInfo['td_is_a_rebill'], intval($transInfo['amount']) < 10);
    $params['nTransactionID'] = $transInfo['td_bank_transaction_id'];
    $processor = new AmeriNet_Client($bankInfo);
    $process_result = $processor->ExecuteOrderVoid($params);
    $response['success'] = false;
    $response['cancelstatus'] = 'N';
    $response['errormsg'] = $process_result['ResultCodeText'];
    $response['errorcode'] = $process_result['ResultCode'];
    $response['td_process_query'] = "";
    $response['td_process_result'] = serialize($process_result);
    if ($process_result['ResultCode'] == '0101') {
        $response['cancelstatus'] = 'Y';
        $response['success'] = true;
    }
    return $response;
}