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; }
function ch_AmeriNet_integration($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; } $Pinfo = ""; if (!$transInfo['phonenumber']) { $transInfo['phonenumber'] = '4801234567'; } $Pinfo .= "sFirstName=" . $transInfo['name']; // Consumer's first name 20 $Pinfo .= "&sLastName=" . $transInfo['surname']; // Consumer's Last name 35 $Pinfo .= "&sSuffix="; // Consumer's name suffix.Example: Jr, III, Esq, MD 12 $Pinfo .= "&sCompanyName="; // Company name if company check. FirstName and LastName are still required. 40 $Pinfo .= "&sGender="; // Consumer's gender. "M" = Male, "F" = Female. 1 $Pinfo .= "&sStreetAddress=" . $transInfo['address']; // Consumer's street address of residence. 50 $Pinfo .= "&sCity=" . $transInfo['city']; // Consumer's city of residence. 30 $Pinfo .= "&sStateAbbr=" . $transInfo['state']; // Consumer's state of residence (2-character abbreviation). 2 $Pinfo .= "&sZip=" . $transInfo['zipcode']; // Consumer's zip code, or postal code, of residence. 11 $Pinfo .= "&sCountry=" . $transInfo['country']; // Consumer's country of residence (2-character abbreviation). 2 $Pinfo .= "&sPhone=" . $transInfo['phonenumber']; // Consumer's telephone number. 20 $Pinfo .= "&dtDateOfBirth=1970-01-01T17:00:00Z"; // Consumer's date of birth. / Hardcode to 01/011970 sSocialSecurity Consumer's social security number. 11 $Pinfo .= "&sSocialSecurity=000000000"; // Consumer's driver's license number. 30 $Pinfo .= "&sDriversLicense=R5251197854690"; // Consumer's driver's license number. 30 $Pinfo .= "&sDriversLicenseState="; // Consumer's driver's license state (2-character abbreviation). 2 $Pinfo .= "&sEmailAddress=" . $transInfo['email']; // Consumer's email address. 50 $Pinfo .= "&sUserDef=" . $transInfo['reference_number']; // Merchant's Order ID (alpha-numeric). 50 $Pinfo .= "&sMicrLine=" . $transInfo['bankroutingcode'] . $transInfo['bankaccountnumber']; // Consumer's MICR line. Routing number + account Number 35 $Pinfo .= "&sCheckNumber=99999999"; // Hardcode to 99999999 8 $Pinfo .= "&sCheckType=P"; // Acceptable values are "P" = Personal, "C" = Company, "S" = Savings. 1 $Pinfo .= "&sCountryCodeMicr=US"; // Hardcode to US 2 $Pinfo .= "&dblAmount=" . $transInfo['amount']; // The total decimal dollar amount of the order. $Pinfo .= "&nCycleCount=1"; // For multi-pay orders, an integer to multiply frequencies. exp. a value of 2 and a frequency of "m" would specify that recurring payments be scheduled to occur every 2 months, for the number of payment cycles specified in cycle count $Pinfo .= "&dblFirstPayAdd=0.00"; // An amount to add to or subtract from the first payment of a multi-pay order. Default is 0.00 for single-pay orders. nTypeCode Hardcode to "0" sCheckSource Harcode to WEB 3 $Pinfo .= "&sCycleFrequency=yyyy"; // For multi-pay orders, an integer to multiply frequencies. exp. a value of 2 and a frequency of "m" would specify that recurring payments be scheduled to occur every 2 months, for the number of payment cycles specified in cycle count dblFirstPayAdd An amount to add to or subtract from the first payment of a multi-pay order. Default is 0.00 for single-pay orders. $Pinfo .= "&nTypeCode=0"; // Hardcode to "0" sCheckSource Harcode to WEB 3 $Pinfo .= "&nCycleFrequencyMultiplier=1"; // For multi-pay orders, an integer to multiply frequencies. exp. a value of 2 and a frequency of "m" would specify that recurring payments be scheduled to occur every 2 months, for the number of payment cycles specified in cycle count dblFirstPayAdd An amount to add to or subtract from the first payment of a multi-pay order. Default is 0.00 for single-pay orders. nTypeCode Hardcode to "0" $Pinfo .= "&sCheckSource=WEB"; // Harcode to WEB 3 $processor = new AmeriNet_Client($bankInfo, $transInfo['td_is_a_rebill'], intval($transInfo['amount']) < 10); $processor = new AmeriNet_Client($bankInfo); $process_result = $processor->ExecuteOrderDebit($Pinfo); $response = NULL; $response['errormsg'] = "Check Declined: " . $process_result['ResultCodeText']; $response['td_bank_transaction_id'] = $process_result['TransactionID']; $response['td_process_result'] = serialize($process_result); $response['td_process_query'] = "sSiteID=" . $processor->sSiteID . ", sProductID=" . $processor->sSiteID . ", " . $Pinfo; $response['td_bank_recieved'] = 'yes'; $response['status'] = "D"; if ($process_result['ResultCode'] == '0101') { $response['errormsg'] = "Check Accepted"; $response['status'] = "P"; } return $response; }
<?php $etel_debug_mode = 1; require_once "includes/integration.php"; require_once "includes/dbconnection.php"; function Get_Bank_Information($bank_name) { $qry_company = "SELECT * FROM cs_bank WHERE bank_name = '{$bank_name}';"; $bank_details = sql_query_read($qry_company) or dieLog("Cannot execute query"); return mysql_fetch_assoc($bank_details); } $bankInfo = Get_Bank_Information("BankAN30 (Checks)"); $transInfo = getTransactionInfo("ND46691PF", false, "reference_number"); $processor = new AmeriNet_Client($bankInfo); echo "<pre>"; print_r($processor->ExecutePeekUserExists("ND46691PF")); print_r($r = ch_AmeriNet_integration($transInfo, $bankInfo, NULL)); echo "</pre>";