예제 #1
0
 $transaction_type = $str_sel_row[6];
 $trans_amount = $amount;
 //refnum
 $ref_no = func_Trans_Ref_No($trans_id);
 $str_qry_update_ref = "UPDATE  cs_transactiondetails set  reference_number='{$ref_no}', currencytype ='{$processing_currency}' WHERE transactionId ='{$trans_id}'";
 if (!($str_result_update_ref = mysql_query($str_qry_update_ref, $cnn_cs))) {
     echo "error on update";
     exit;
 }
 exit;
 $trans_amount *= 100;
 if ($state == "") {
     $state = "Others";
 }
 $abbrCountry = func_country_abbreviation($country);
 $abbrState = func_state_abbreviation($state);
 $bank_CreditcardId = $bank_Creditcard;
 if ($bank_CreditcardId == 6 || $bank_CreditcardId == 7 || $bank_CreditcardId == 8) {
     $bUserId = $bank_Username;
     $bUserPassword = $bank_Password;
     if ($bUserId == "") {
         $bUserId = 8;
     }
     if ($bUserPassword == "") {
         $bUserPassword = "******";
     }
     $firstnum = substr($CCnumber, 0, 0);
     if ($firstnum == "5") {
         $cardtype = "Visa";
     } else {
         $cardtype = "Master";
예제 #2
0
function func_insert_transactionCreditdata($array_transdetails, $company_id_val, $cnn_connection)
{
    $trans_insert_status = "";
    $reference_number = "NIL";
    $str_invalid_date = "";
    if (count($array_transdetails) > 0) {
        $telephoneno = $array_transdetails[7];
        /*	$format_split_date = split("/",$array_transdetails[15]);
        			if(count($format_split_date)== 3 ) {			
        				$format_split_date[0] = strlen(trim($format_split_date[0])) == 1 ? "0".$format_split_date[0] : $format_split_date[0];
        				$format_split_date[1] = strlen(trim($format_split_date[1])) == 1 ? "0".$format_split_date[1] : $format_split_date[1];
        				$trans_date_enter = "$format_split_date[0]-$format_split_date[1]-$format_split_date[2]:00";
        				$trans_date_enter = func_get_date_inyyyymmdd_time($trans_date_enter);
        			} else {
        				$trans_date_enter = "";
        			}*/
        $trans_date_enter = date("Y-m-d H:i:s");
        if ($trans_date_enter == "") {
            $str_invalid_date = "Invalid Date";
        } else {
            $name = trim($array_transdetails[0]);
            $surname = trim($array_transdetails[1]);
            $address = trim($array_transdetails[2]);
            $city = trim($array_transdetails[3]);
            $state = trim($array_transdetails[4]);
            $zipcode = trim($array_transdetails[5]);
            $country = trim($array_transdetails[6]);
            $phonenumber = trim($array_transdetails[7]);
            $email = trim($array_transdetails[8]);
            $amount = trim($array_transdetails[9]);
            $checkorcard = "H";
            $cardType = trim($array_transdetails[10]);
            $CCnumber = trim($array_transdetails[11]);
            $cvv = trim($array_transdetails[12]);
            $validupto = trim($array_transdetails[13]);
            $transactionDate = date("Y-m-d H:i:s");
            $productdescription = trim($array_transdetails[14]);
            $billingDate = trim($array_transdetails[15]);
            $firstnum = substr($CCnumber, 0, 1);
            if ($firstnum == "5") {
                $cardType = "Master";
            } else {
                $cardType = "Visa";
            }
            $userid = $company_id_val;
            $domain = GetHostByName($_SERVER["REMOTE_ADDR"]);
            $temp = $billingDate;
            $tem = explode("/", $temp);
            $mm = $tem[0];
            $dd = $tem[1];
            $yyyy = $tem[2];
            $d = $yyyy . "-" . $mm . "-" . $dd;
            $qrt_insert_details = "insert into cs_transactiondetails (name,surname,address,city,state,zipcode,country,phonenumber,email,amount,checkorcard,cardtype,CCnumber,cvv,validupto,transactionDate,billingDate,userid,passStatus,pass_count,cancelstatus,status,ipaddress,productdescription,declinedReason,company_usertype,company_user_id)\n\t\t\t\t  values('{$array_transdetails['0']}','{$array_transdetails['1']}','{$array_transdetails['2']}','{$array_transdetails['3']}','{$array_transdetails['4']}','{$array_transdetails['5']}','{$array_transdetails['6']}','{$array_transdetails['7']}','{$array_transdetails['8']}',{$array_transdetails['9']},'H','{$cardType}','{$array_transdetails['11']}','{$array_transdetails['12']}','{$array_transdetails['13']}','{$trans_date_enter}','{$d}',{$company_id_val},'PA',0,'N','D','{$domain}','{$array_transdetails['14']}','Error in data',5,{$userid})";
            // print $qrt_insert_details ."<br>";
        }
        if (func_isvalidCardnumber($CCnumber)) {
            if (func_isvalidCardnumber($cvv)) {
                if ($str_invalid_date == "") {
                    // Credit card details.
                    if (!($sql_insert_data = mysql_query($qrt_insert_details))) {
                        $trans_insert_status = "failure";
                    } else {
                        $transactionId = mysql_insert_id();
                        $ref_number = func_Trans_Ref_No($transactionId);
                        $updateSuccess = "";
                        $updateSuccess = func_update_single_field('cs_transactiondetails', 'reference_number', $ref_number, 'transactionId', $transactionId, $cnn_connection);
                        func_update_rate($userid, $transactionId, $cnn_connection);
                        if ($updateSuccess = 1) {
                            $reference_number = $ref_number;
                        }
                        $qrt_select_company = "Select companyname,transaction_type,billingdescriptor,email,send_mail,send_ecommercemail,bank_Creditcard,bank_shopId,bank_Username,bank_Password,processing_currency from cs_companydetails where userid='{$company_id_val}'";
                        if (!($show_sql_run = mysql_query($qrt_select_company))) {
                            dieLog(mysql_errno() . ": " . mysql_error() . "<BR>");
                        } else {
                            if (mysql_num_rows($show_sql_run) == 0) {
                                $msgtodisplay = "You are not a valid user";
                                $outhtml = "y";
                                message($msgtodisplay, $outhtml, $headerInclude);
                                exit;
                            } else {
                                $company_name = mysql_fetch_array($show_sql_run);
                                $transaction_type = mysql_result($show_sql_run, 0, 1);
                                $billingdescriptor = mysql_result($show_sql_run, 0, 2);
                                $fromaddress = mysql_result($show_sql_run, 0, 3);
                                $send_mails = mysql_result($show_sql_run, 0, 4);
                                $send_ecommercemail = mysql_result($show_sql_run, 0, 5);
                                $bank_CreditcardId = mysql_result($show_sql_run, 0, 6);
                                $bank_shopId = mysql_result($show_sql_run, 0, 7);
                                $bank_Username = mysql_result($show_sql_run, 0, 8);
                                $bank_Password = mysql_result($show_sql_run, 0, 9);
                                $processing_currency = func_get_cardcurrency($cardType, $company_id_val, $cnn_connection);
                                func_ins_bankrates($transactionId, $bank_CreditcardId, $cnn_connection);
                                $firstnum = "";
                                if ($processing_currency == "") {
                                    $processing_currency = "USD";
                                }
                                $updateSuccess = func_update_single_field('cs_transactiondetails', 'currencytype ', $processing_currency, 'transactionId', $transactionId, $cnn_connection);
                                $updateSuccess = func_update_single_field('cs_transactiondetails', 'bank_id ', $bank_CreditcardId, 'transactionId', $transactionId, $cnn_connection);
                                $firstnum = substr($CCnumber, 0, 1);
                                if ($firstnum == "5") {
                                    $cardType = "Master";
                                } else {
                                    $cardType = "Visa";
                                }
                                $cardExpir = split("/", $validupto);
                                $year = $cardExpir[0];
                                $cardExpire = $cardExpir[1] . "/" . substr($year, 2, 3);
                                $abbrCountry = func_country_abbreviation($country);
                                $abbrState = func_state_abbreviation($state);
                                // function for submitting to bank
                                // print "func_volpay_bankprocess($bank_Username,$bank_Password,$reference_number,$cardType,$CCnumber,$cardExpire,$cvv,$name,$surname,$address,$zipcode,$city,$abbrCountry,$phonenumber,$abbrState,$email,$processing_currency,$amount,$cnn_connection,$transactionId)";
                                if ($bank_CreditcardId == 6 || $bank_CreditcardId == 7 || $bank_CreditcardId == 8) {
                                    $trans_insert_status = func_volpay_bankprocess($bank_Username, $bank_Password, $reference_number, $cardType, $CCnumber, $cardExpire, $cvv, $name, $surname, $address, $zipcode, $city, $abbrCountry, $phonenumber, $abbrState, $email, $processing_currency, $amount, $cnn_connection, $transactionId, $company_id_val);
                                } else {
                                    if ($bank_CreditcardId == 3) {
                                        $cardTypeBr = $cardType == "Visa" ? "V" : "M";
                                        $trans_insert_status = func_bardo_bankprocess($bank_shopId, "Service", $processing_currency, $reference_number, $surname, $name, $email, $address, $city, $zipcode, $abbrState, $abbrCountry, $phonenumber, $amount, $cardTypeBr, $CCnumber, $cardExpire, $cvv, $transaction_type, $transactionId, $cnn_connection);
                                    }
                                }
                            }
                        }
                    }
                } else {
                    $trans_insert_status = $str_invalid_date;
                }
            } else {
                $trans_insert_status = "Error in Data";
            }
        } else {
            $trans_insert_status = "Error in Data";
        }
        print "<tr height='20'><td class='leftbottomright'><font face='verdana' size='1'>&nbsp;{$reference_number}</font></td><td class='leftbottomright'><font face='verdana' size='1'>&nbsp;{$array_transdetails['0']}</font></td><td class='cl1'><font face='verdana' size='1'>&nbsp;{$array_transdetails['1']}</font></td><td class='cl1'><font face='verdana' size='1'>&nbsp;{$array_transdetails['2']}</font></td><td class='cl1'><font face='verdana' size='1'>&nbsp;{$array_transdetails['8']}</font></td><td class='cl1'><font face='verdana' size='1'>&nbsp;{$array_transdetails['7']}</font></td><td class='cl1'><font face='verdana' size='1'>&nbsp;{$trans_insert_status}</font></td></tr>";
    }
}
예제 #3
0
 $str_address_fontsize = isset($HTTP_POST_VARS['opt_fontsize_address']) ? $HTTP_POST_VARS['opt_fontsize_address'] : "2";
 $str_city_font = isset($HTTP_POST_VARS['opt_font_city']) ? $HTTP_POST_VARS['opt_font_city'] : "Verdana";
 $str_city_fontsize = isset($HTTP_POST_VARS['opt_fontsize_city']) ? $HTTP_POST_VARS['opt_fontsize_city'] : "2";
 $str_state_font = isset($HTTP_POST_VARS['opt_font_state']) ? $HTTP_POST_VARS['opt_font_state'] : "Verdana";
 $str_state_fontsize = isset($HTTP_POST_VARS['opt_fontsize_state']) ? $HTTP_POST_VARS['opt_fontsize_state'] : "2";
 $str_pc_font = isset($HTTP_POST_VARS['opt_font_pc']) ? $HTTP_POST_VARS['opt_font_pc'] : "Verdana";
 $str_pc_fontsize = isset($HTTP_POST_VARS['opt_fontsize_pc']) ? $HTTP_POST_VARS['opt_fontsize_pc'] : "2";
 for ($i_loop = 0; $i_loop < mysql_num_rows($rst_select); $i_loop++) {
     $i_col_count++;
     $str_first_name = mysql_result($rst_select, $i_loop, 0);
     $str_name = mysql_result($rst_select, $i_loop, 1);
     $str_address = mysql_result($rst_select, $i_loop, 2);
     $str_city = mysql_result($rst_select, $i_loop, 3);
     $str_state = mysql_result($rst_select, $i_loop, 4);
     if ($str_state != "") {
         $str_state_val = func_state_abbreviation($str_state);
     }
     $str_zip_code = mysql_result($rst_select, $i_loop, 5);
     if ($i_col_count == 1) {
         print "<table width='585' border='0' cellspacing='0' cellpadding='0'>";
         print "<tr>";
     }
     print "<td width='186' height='72' align='left' valign='top'>";
     if ($str_fname_order == 1) {
         print "<font face='{$str_fname_font}' size='{$str_fname_fontsize}'>{$str_first_name}</font>&nbsp;<font face='{$str_sname_font}' size='{$str_sname_fontsize}'>{$str_name}</font><br>";
     } else {
         print "<font face='{$str_sname_font}' size='{$str_sname_fontsize}'>{$str_name}</font>&nbsp;<font face='{$str_fname_font}' size='{$str_fname_fontsize}'>{$str_first_name}</font><br>";
     }
     print "<font face='{$str_address_font}' size='{$str_address_fontsize}'>" . $str_address . "</font><br>";
     print "<font face='{$str_city_font}' size='{$str_city_fontsize}'>" . $str_city . "</font><br>";
     print "<font face='{$str_state_font}' size='{$str_state_fontsize}'>" . $str_state_val . "</font>&nbsp;&nbsp;";