Пример #1
0
exit();
*/
/*
require_once("includes/subFunctions/banks.checkgateway.php");

$bankInfo = bank_GetByID("32");
$processor = new CheckGateway_Client($bankInfo,"Live");
$log = $processor->process_transactions();
echo $log;
*/
require_once "includes/SOAP/Client.php";
require_once "includes/subFunctions/banks.ipaygate.php";
$bankInfo = bank_GetByID(33);
$trans = new transaction_class();
$trans->pull_transaction("10001722");
$processor = new iPayGate_Client($bankInfo);
$transInfo = $trans->row['transactionTable'];
$params = array("customerpaymentpagetext" => "0001ETELEG01", "orderDescription" => "0001etelegate.net 1800-6760127", "currencyText" => "USD", "taxAmount" => "0", "purchaseAmount" => "1.95", "cardHolderName" => "fdgsgsd sgddstgsdg", "cardNo" => "4444333322221111", "cardTypeText" => "visa", "securityCode" => "123", "cardExpireMonth" => "08", "cardExpireYear" => "2020");
$res = $processor->Execute_Sale($params);
echo "<pre>";
print_r($res);
echo "</pre>";
/*

$compinfo = merchant_getInfo(1328);
$contract = genMerchantContract($compinfo);
echo $contract['et_htmlformat'];
*/
//////////////////////////////////////////
$query_info = "<table width='800px'><tr><td><font style='font-size:8pt;'>";
if (isset($etel_query_info['results'])) {
Пример #2
0
function cc_iPayGate_integration(&$transInfo, $bankInfo, $companyInfo)
{
    global $etel_fraud_limit;
    require_once "SOAP/Client.php";
    require_once "subFunctions/banks.ipaygate.php";
    $response = "";
    $response['errormsg'] = "Transaction could not be processed.";
    $expDate = explode("/", $transInfo['validupto']);
    $expYear = $expDate[0];
    $expMonth = $expDate[1];
    $TID = "ETELEGATE01";
    $MID = "ca7e5842-dd33-1029-bf92-0013723bba63";
    //if($bankInfo['cb_config']['custom']['tid_sites'][$transInfo['td_site_ID']]) $TID = $bankInfo['cb_config']['custom']['tid_sites'][$transInfo['td_site_ID']];
    $DESC = "www.pay-support.com 1-800-511-2457";
    //if($bankInfo['cb_config']['custom']['desc_sites'][$transInfo['td_site_ID']]) $DESC = $bankInfo['cb_config']['custom']['desc_sites'][$transInfo['td_site_ID']];
    //$transInfo['billing_descriptor']=$DESC;
    $cust_cntry = $transInfo['country'];
    //urlencode(func_get_country($transInfo['country'],'co_full'));
    $transInfo['cardtype'] = 'Visa';
    if (substr($transInfo['CCnumber'], 0, 1) == '5') {
        $transInfo['cardtype'] = 'Mastercard';
    }
    $params = array("customerPaymentPageText" => strval($TID), "orderDescription" => strval($MID), "currencyText" => strval("USD"), "taxAmount" => strval("0"), "dutyAmount" => strval("0"), "purchaseAmount" => "" . number_format($transInfo['amount'], 2) . "", "cardHolderName" => strval($transInfo['name'] . " " . $transInfo['surname']), "firstName" => strval($transInfo['name']), "lastName" => strval($transInfo['surname']), "cardNo" => strval($transInfo['CCnumber']), "cardTypeText" => strval(strtoupper($transInfo['cardtype'])), "securityCode" => strval($transInfo['cvv']), "cardExpireMonth" => strval($expMonth), "cardExpireYear" => strval($expYear), "cardIssueMonth" => strval('0'), "cardIssueYear" => strval('0'), "country" => strval($cust_cntry), "address" => strval($transInfo['address']), "city" => strval($transInfo['city']), "state" => strval($transInfo['state']), "zip" => strval($transInfo['zipcode']), "email" => strval('1' . $transInfo['email']), "phone" => strval($transInfo['phonenumber']), "cardHolderIP" => strval($transInfo['ipaddress']));
    $Pinfo .= "&P5=" . urlencode($transInfo['address']);
    //Address1	Y	(1,30) Varchar
    $Pinfo .= "&P6=" . urlencode($transInfo['address2']);
    //Address2	N	(1,30) Varchar
    $Pinfo .= "&P7=" . urlencode($transInfo['city']);
    //City	Y	(1,25) Varchar
    $Pinfo .= "&P8=" . urlencode($transInfo['state']);
    //State	Y	(1,8) Varchar
    $Pinfo .= "&P9=" . urlencode($transInfo['zipcode']);
    //Zip Code	Y	(5,9) Varchar
    $processor = new iPayGate_Client($bankInfo);
    $process_result = $processor->Execute_Sale($params);
    $process_result_array = xml2array($process_result);
    foreach ($process_result_array['wddxPacket']['data']['struct']['var'] as $varinfo) {
        $process_result_var[$varinfo['attributes']['name']] = @array_pop($varinfo['string']);
    }
    //print_r($process_result_var);
    //print_r($params);
    $response = NULL;
    list($ResponseNum, $ResponseMsg) = split(' - ', $process_result_var['RESPONSECODE']);
    $response['errormsg'] = $process_result_var['ERRORCODE'] . ": {$ResponseNum} " . $process_result_var['ERRORMESSAGE'];
    if ($response['errormsg'] == ":  ") {
        $response['errormsg'] = "Declined (SoEx)";
    }
    if ($processor->resultCodes[$ResponseNum]) {
        $response['td_process_msg'] = "{$ResponseNum}: " . $processor->resultCodes[$ResponseNum];
    } else {
        $response['td_process_msg'] = $response['errormsg'];
    }
    $response['td_bank_transaction_id'] = $process_result_var['ORDERREFERENCE'];
    $response['td_process_result'] = serialize($process_result_var);
    $response['td_process_query'] = serialize($params);
    $response['td_bank_recieved'] = 'yes';
    if ($process_result_var['ERRORCODE'] != '11063') {
        $response['td_bank_recieved'] = 'no';
    }
    $response['status'] = "D";
    if ($process_result_var['ERRORCODE'] == '000' || $process_result_var['RESPONSECODE'] == '000 - APPROVED') {
        $response['errormsg'] = "Card Accepted";
        $response['status'] = "A";
        $response['td_bank_recieved'] = 'yes';
    }
    return $response;
}
Пример #3
0
function cc_iPayGate_refund($transInfo, $bankInfo, $companyInfo)
{
    require_once "subFunctions/banks.ipaygate.php";
    require_once "SOAP/Client.php";
    $response = "";
    $response['errormsg'] = "Transaction could not be processed.";
    $processor = new iPayGate_Client($bankInfo);
    //$orig_query = explode("?",$transInfo['td_process_query']);
    $orig_result = unserialize(str_replace('[credit_card]', etelDec($transInfo['CCnumber']), $transInfo['td_process_result']));
    $params = array("customerPaymentPageText" => strval($orig_result['CUSTOMERPAYMENTPAGETEXT']), "orderDescription" => strval($orig_result['ORDERDESCRIPTION']), "refundamount" => strval($transInfo['amount']), "referralorderreference" => strval($orig_result['ORDERREFERENCE']), "comment1" => strval(substr($transInfo['reason'], 0, 249)));
    $process_result = $processor->Execute_Refund($params);
    $response['success'] = false;
    $response['cancelstatus'] = 'N';
    $response['errormsg'] = $process_result['TRANSACTIONSTATUSTEXT'] . ': ' . $process_result['ERRORMESSAGE'];
    $response['errorcode'] = $process_result['ERRORCODE'];
    $response['td_process_query'] = serialize($params);
    $response['td_process_result'] = serialize($process_result);
    if ($process_result['RESPONSECODE'] == '000' || $process_result['TRANSACTIONSTATUSTEXT'] == 'SUCCESSFUL') {
        $response['cancelstatus'] = 'Y';
        $response['success'] = true;
    }
    return $response;
}