Example #1
0
function post_passwordmgmt_query($url, $fields, $id)
{
    if ($url != "") {
        $parseurl = parse_url($url);
        $postmet = $parseurl['scheme'];
        $postser = $parseurl['host'];
        $postport = stristr($postmet, "https") !== FALSE ? "443" : "80";
        $postser = (stristr($postmet, "https") !== FALSE ? "ssl://" : "") . $postser;
        $postdata = NULL;
        foreach ($fields as $key => $data) {
            $postdata .= ($postdata ? "&" : "") . "{$key}={$data}";
        }
        $done = 0;
        $succ['query'] = $url . "?" . $postdata;
        $succ['body'] = http_post2($postser, $postport, $url . "?" . $postdata, $postdata);
        if (!$succ['body']) {
            $done = 0;
        } else {
            //if(stristr($succ['head'],"HTTP/1.1") === FALSE || stristr($succ['head'],"HTTP/1.0") === FALSE || stristr($succ['head'],"HTTP/1.1 200 OK")!==FALSE || stristr($succ['head'],"HTTP/1.0 200 OK")!==FALSE)
            $done = 1;
        }
        //successfully posted data
        //else
        //	$done = 0; //problem with destination
        if ($done != 1) {
            toLog("notify", "system", "Notify Error: " . $succ['body'] . " Query: " . $succ['query'], $id);
        } else {
            toLog("notify", "system", "Notify Success: " . $succ['body'] . " Query: " . $succ['query'], $id);
        }
        return array("succeeded" => $done, "response" => $succ);
    }
    return array("succeeded" => "0", "response" => array("url" => $posturl, "head" => "no url specified", "body" => "no url specified"));
}
Example #2
0
function cc_novapay_integration_rebill($transInfo, $bankInfo, $companyInfo)
{
    global $etel_fraud_limit;
    $response = "";
    $response['errormsg'] = "";
    $response['success'] = false;
    $response['td_bank_recieved'] = 'no';
    if ($bankInfo['bk_cc_support'] != 1) {
        $response['errormsg'] = "This bank does not support this Integration Function. Please contact an administrator.";
        return $response;
    }
    $expDate = explode("/", $transInfo['validupto']);
    $expYear = $expDate[0];
    $expMonth = $expDate[1];
    $expDate = $expMonth . $expYear;
    $cust_cntry = urlencode(func_get_country($transInfo['country'], 'co_ISO'));
    //if(!$transInfo['cvv']) $transInfo['cvv'] = rand(120,999);
    //FunctionID	002	Y
    $Pinfo = "";
    $Pinfo .= "merchantId=" . urlencode($bankInfo['bk_username']);
    //
    $Pinfo .= "&validationCode=" . urlencode($bankInfo['bk_password']);
    //
    $Pinfo .= "&referenceId=" . urlencode($transInfo['reference_number']);
    //
    $Pinfo .= "&customer_country=" . $cust_cntry;
    //
    $Pinfo .= "&customer_language=ENG";
    //
    $Pinfo .= "&customer_email=" . urlencode($transInfo['email']);
    //	 	novapaycustomer@etelegate.com
    //$Pinfo.="&pay_cents=".urlencode(round(($transInfo['amount'])*100)); //
    $Pinfo .= "&amount=" . number_format($transInfo['amount'], 2, '.', '');
    //
    $Pinfo .= "&currency=USD";
    //
    //$Pinfo.="&contracttext=123"; //
    $Pinfo .= "&cardNumber=" . urlencode($transInfo['CCnumber']);
    //
    $Pinfo .= "&cardExpiration=" . urlencode($expMonth) . '/' . urlencode(substr($expYear, 2, 2));
    //
    //$Pinfo.="&cardholder_firstname=".urlencode($transInfo['name']); //
    //$Pinfo.="&cardholder_lastname=".urlencode($transInfo['surname']); //
    //$Pinfo.="&card_cvc=".urlencode($transInfo['cvv']); //
    //$Pinfo.="&_merchant_css=123"; //
    //$Pinfo.="&_merchant_timeout=123"; //
    //$Pinfo.="&_merchant_security_data=123"; //
    //$Pinfo.="&_customer_phone=".urlencode($transInfo['phonenumber']); //
    $Pinfo .= "&firstName=" . urlencode($transInfo['name']);
    //
    $Pinfo .= "&lastName=" . urlencode($transInfo['surname']);
    //
    $Pinfo .= "&addrStreet1=" . urlencode($transInfo['address']);
    //
    $Pinfo .= "&addrCountry=" . urlencode($transInfo['country']);
    //
    $Pinfo .= "&addrPostalCode=" . urlencode($transInfo['zipcode']);
    //
    $Pinfo .= "&productDescription=" . urlencode($transInfo['city']);
    //
    //$Pinfo.="&_pay_prodid=123"; //
    // Uncomment below for live
    $query_url = "https://secure.securenpay.com/SNPWebService.asmx/RequestCardAuthCapture?";
    $output_url = $query_url . $Pinfo;
    $output_url = str_replace(" ", "%20", $output_url);
    $process_result = http_post2('ssl://secure.securenpay.com', 443, $output_url, $Pinfo);
    toLog('order', 'customer', "NovaPay Result for " . $transInfo['reference_number'] . ":  " . $process_result, $transInfo['transactionId']);
    $response['td_process_result'] = $process_result;
    $response['td_process_query'] = $output_url;
    $result_array = xml2array($process_result);
    //$response['result_array'] = $result_array;
    $response['errormsg'] = $result_array['SnpResponse']['ResponseMessage'];
    $response['errorcode'] = $result_array['SnpResponse']['ResponseCode'];
    if (!$response['errormsg']) {
        $response['errormsg'] = "Declined";
    }
    $response['success'] = true;
    $response['status'] = "D";
    $response['td_bank_recieved'] = 'yes';
    if ($response['errorcode'] == "1") {
        $response['status'] = "A";
    }
    $response['td_bank_transaction_id'] = $result_array['SnpResponse']['RequestAuthCapture']['TransactionId'];
    return $response;
}
 function process_request($params)
 {
     if ($params == NULL) {
         $params = array();
     }
     $post_params = "";
     $params = array_merge($this->default_params, $params);
     $lo_params = array();
     foreach ($params as $name => $value) {
         $lo_params[$name] = $value;
     }
     foreach ($this->bank_params as $index => $name) {
         if (isset($lo_params[$name])) {
             $post_params .= ($post_params == "" ? "" : "&") . $name . "=" . urlencode($lo_params[$name]);
         }
     }
     $post_url = $this->bank_url . $this->bank_script . "?{$post_params}";
     $this->url = $post_url;
     $res = http_post2($this->bank_server, 443, $post_url, $post_params, "", "");
     return $res;
 }
 function process_request($params)
 {
     if ($params == NULL) {
         $params = array();
     }
     $post_params = "";
     $params = array_merge($this->default_params, $params);
     foreach ($params as $name => $value) {
         if (in_array(strtolower($name), $this->bank_params)) {
             $post_params .= ($post_params == "" ? "" : "&") . $name . "=" . urlencode($value);
         }
     }
     $post_url = $this->bank_url . $this->bank_script;
     $this->url = $post_url . "?" . $post_params;
     $res = http_post2($this->bank_server, 443, $post_url, $post_params, "", "");
     return $res;
 }
Example #5
0
function cc_i24Card_integration($transInfo, $bankInfo, $companyInfo)
{
    global $etel_fraud_limit;
    $response = "";
    $response['errormsg'] = "No Error 15";
    $response['success'] = false;
    $response['td_bank_recieved'] = 'no';
    //include('snoopy/Snoopy.class.php');
    // Fraud Scrubbing
    $scrub_response = execute_scrub_tests(&$transInfo, &$bankInfo, &$companyInfo);
    if ($scrub_response != -1) {
        return $scrub_response;
    }
    if ($bankInfo['bk_cc_support'] != 1) {
        $response['errormsg'] = "This bank does not support this Integration Function. Please contact an administrator.";
        return $response;
    }
    //$cust_state = func_get_state($transInfo['state'],'st_full');
    $expDate = explode("/", $transInfo['validupto']);
    $expYear = substr($expDate[0], -2, 2);
    $expMonth = $expDate[1];
    //if(!$transInfo['td_is_a_rebill'])
    $expDate = $expMonth . $expYear;
    //else $expDate='';
    $cust_cntry = urlencode(func_get_country($transInfo['country'], 'co_ISO'));
    //foreach($transInfo as $key => $info)
    //$transInfo[$key] = urlencode($info);
    $i24_msg_id = rand(0, 400000000000);
    $response['td_bank_transaction_id'] = $i24_msg_id;
    $additional_array = explode('|', $bankInfo['bk_additional_id']);
    //FunctionID	002	Y
    $Pinfo = "";
    $Pinfo .= "CID=" . $additional_array[0];
    $Pinfo .= "&CUSR="******"&CPWD=" . $bankInfo['bk_password'];
    if (!is_numeric($transInfo['td_gcard'])) {
        $transInfo['td_is_a_rebill'] = 0;
    }
    if (!$transInfo['td_is_a_rebill']) {
        $Pinfo .= "&FUNC=002";
    } else {
        $Pinfo .= "&FUNC=003";
    }
    $Pinfo .= "&MSGID=" . $i24_msg_id;
    if (!$transInfo['td_is_a_rebill']) {
        $Pinfo .= "&P1=" . rand(0, 400000000);
    } else {
        $Pinfo .= "&P1=" . $transInfo['td_gcard'];
    }
    //Electron Card  Y	(1,9) Numeric
    $Pinfo .= "&P2=" . urlencode($transInfo['name']);
    //First Name	Y	(1,20) Varchar
    $Pinfo .= "&P3=" . urlencode($transInfo['initial']);
    //Middle Initial	N	(1,1) Varchar
    $Pinfo .= "&P4=" . urlencode($transInfo['surname']);
    //Last Name	Y	(1,20) Varchar
    $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
    $Pinfo .= "&P10=" . $cust_cntry;
    //Country Code (ISO 3166)	Y	(2) Varchar Alpha
    //$Pinfo.="&P11=123"; //UDF1	N	(255) varchar
    //$Pinfo.="&P12=123"; //UDF2	N	(255) varchar
    //$Pinfo.="&P13=123"; //UDF3	N	(255) varchar
    //$Pinfo.="&P14=123"; //UDF4	N	(255) varchar
    //$Pinfo.="&P15=123"; //UDF5	N	(255) varchar
    $Pinfo .= "&P16=" . urlencode($transInfo['email']);
    //	Email	Y	(1,40) varchar
    $Pinfo .= "&P17=" . urlencode(round($transInfo['amount'] * 100));
    //	Load Amount – Represents the amount of money on the initial load when assigning the card number	Y	Numeric (See 1.1.5)
    if (!$transInfo['td_is_a_rebill']) {
        $Pinfo .= "&P18=" . ($transInfo['CCnumber'] ? $transInfo['CCnumber'] : $transInfo['td_gcard']);
    } else {
        $Pinfo .= "&P18=";
    }
    //	Credit Card – Card number to charge for the Amount (P17) if a load is required.	Y	(1,26) Numeric
    //if(!$transInfo['cvv']) $transInfo['cvv']= 123;
    $Pinfo .= "&P19=" . $expDate;
    //	Credit Card Expiry Date – Expiration date of the credit card. MMYY	Y	(1,4) Numeric
    if (!$transInfo['td_is_a_rebill']) {
        $Pinfo .= "&P20=";
    } else {
        $Pinfo .= "&P20=" . urlencode($transInfo['cvv']);
    }
    //	CVD – Cardholder Verification Data (CVV2,CVC2)	Y	(1,3) Numeric
    $Pinfo .= "&P21=" . round($transInfo['amount'] * 100);
    //	Transfer Amount – Amount to transfer from Electron Card to Web Master.	Y 	(1,9) Varchar
    $Pinfo .= "&P22=" . $additional_array[1];
    //	Merchant Vendor ID -  Virtual ID number linked to a Merchant ID and/or a Merchant Debit Card.	Y	(1,20) Varchar
    $Pinfo .= "&P23=" . $transInfo['ipaddress'];
    //	Cardholder IP Address	Y	(1,15) varchar
    $Pinfo .= "&P24=0";
    //	RSID – Reseller/Referrer ID	Y
    //$Pinfo.="&P25=".$transInfo['company_info']; //	Merchant Descriptor 1	N
    //$Pinfo.="&P26=".$transInfo['company_info']; //	Merchant Descriptor 2	N
    $Pinfo .= "&P27=" . urlencode($transInfo['productdescription']);
    //	Transaction Description	N
    $Pinfo .= "&P28=" . urlencode($transInfo['reference_number']);
    //	Ibill Transaction Tracking ID	Y
    $Pinfo .= "&P29=" . $transInfo['td_is_a_rebill'];
    //	RecurID	Y	0 = not recurring 1 = recurring transaction
    //$Pinfo.="&P30=123"; //	DOB	N	Date (i.e., mm/dd/yyyy or m/d/yyyy)
    //$Pinfo.="&P31=123"; //	Phone	N	(7,15) Varchar
    //$Pinfo.="&P32=123"; //	Sale Flag	N	NOSALE- will not send transaction to sale
    //$Pinfo.="&P33=123"; //	Security Field 1 can include mother’s maiden name or license number	N	(1,22) varchar
    //$Pinfo.="&P34=123"; //	Security Field 1 can include mother’s maiden name or license number	N	(1,22) varchar
    //$Pinfo.="&P35=123"; //	Not Used	N
    //$Pinfo.="&P36=123"; //	User defined field.  It handles special requirements for the client	N	(1,16) varchar
    //$Pinfo.="&P37=123"; //	User defined field.  It handles special requirements for the client l	N	(1,16) varchar
    //$Pinfo.="&P38=123"; //	Social Security Nbr.	N	(1,9) Varchar
    $Pinfo .= "&P39=";
    //	Embossing Data – used for embossing the name of the company on the card	Y	(1,40) Varchar
    //$Pinfo.="&P40=123"; //	Merchant City	N	(1,30) Varchar
    //$Pinfo.="&P41=123"; //	Merchant State	N	(1,30) Varchar
    //$Pinfo.="&P42=123"; //	Merchant Zip	N	(1,30) Varchar
    //$Pinfo.="&P43=123"; //	Merchant Country	N	(1,30) Varchar
    //$Pinfo.="&distributorcode=123"; //	Distributor Code	N	(1,30) Varchar
    if (!$transInfo['td_is_a_rebill']) {
        $Pinfo .= "&issue_physical_card=0";
    }
    //	Whether or not to issue plastic	Y	Boolean
    //$Pinfo.="&Remote_Host=".$transInfo['ipaddress']; //	Whether or not to issue plastic	Y	Boolean
    //$Pinfo.="&password=0"; //	Whether or not to issue plastic	Y	Boolean
    // Uncomment below for live
    $query_url = "https://trans.symmetrex.com/ibill/ibillapi?";
    $output_url = $query_url . $Pinfo;
    $output_url = str_replace(" ", "%20", $output_url);
    //$process_result = file_get_contents($output_url);
    //print($output_url."@");
    //$process_result = file($output_url);
    //print($process_result."2@");
    toLog('order', 'customer', "Symmetrex Post for " . $transInfo['reference_number'] . ":  " . $output_url, $transInfo['transactionId']);
    $process_result = http_post2('ssl://trans.symmetrex.com', 443, $output_url, $Pinfo);
    toLog('order', 'customer', "Symmetrex Result for " . $transInfo['reference_number'] . ":  " . $process_result, $transInfo['transactionId']);
    //if(!$process_result)
    //{
    //$Pinfo="";
    //$Pinfo.="FUNC=004";
    //$Pinfo.="&P1=".$i24_msg_id;
    //$echo_result = http_post('ssl://trans.symmetrex.com', 443, $query_url.$Pinfo, $Pinfo);
    //toLog('order','customer', "Querying server for info on ".$transInfo['reference_number'].":  ".$echo_result." Query: ".$query_url.$Pinfo,$transInfo['transactionId']);
    //}
    $response['td_process_result'] = $process_result;
    //$clean_data = str_replace("\n","&",trim(str_replace("endofdata", "", trim($process_result['0']))));
    parse_str(trim($process_result));
    $response['errormsg'] = $P2;
    $response['errorcode'] = $P1;
    if (!$P3) {
        $response['td_gcard'] = "NULL";
    } else {
        $response['td_gcard'] = "'" . etelEnc($P3) . "'";
    }
    if (!$response['errormsg']) {
        $response['errormsg'] = "Declined";
    }
    $response['success'] = true;
    $response['status'] = "D";
    $response['td_process_query'] = $output_url;
    $response['td_bank_recieved'] = 'yes';
    if ($process_result == '0: Success') {
        $response['td_bank_recieved'] = 'internalerror';
    }
    if ($P2 == "Success") {
        $response['status'] = "A";
    }
    $response['td_bank_transaction_id'] = $P8;
    return $response;
}