GIF89a;
Direktori : /home/serb/public_html/ |
Current File : /home/serb/public_html/pay_now.php |
<? session_start(); include("lib/globals.php"); include("lib/common.php"); include("lib/functions.php"); include "includes/header_top.php"; $SITE_URL = "http://207.198.127.197/~independ/"; if(!isset($_SESSION['SH_ESCORT_ID'])) { header("Location: index.php"); exit; } $sh_payment_mode = "Live"; if(isset($_GET["token"]) && $_GET["token"] != "") { $token = $_GET["token"]; if($sh_payment_mode == "Live") { $sh_get_status_url = "https://ctpe.net/frontend/GetStatus;jsessionid=" . $token; } else { $sh_get_status_url = "https://test.ctpe.net/frontend/GetStatus;jsessionid=" . $token; } $url = $sh_get_status_url; $fp = @fopen($url, 'rb'); $response = @stream_get_contents($fp); $resultJson = json_decode($response, true); if (strstr($resultJson['transaction']['processing']['result'],"ACK")) { $payment_status_sql = "UPDATE `payment_dtls` SET `status` = 'a' WHERE `post_id` = '".$_SESSION['SH_ESCORT_ID']."' AND `status` = 'u'"; execute_query($payment_status_sql) or die(mysql_error()); $escort_status_sql = "UPDATE `escort_details` SET `status` = 'a' WHERE `id` = '".$_SESSION['SH_ESCORT_ID']."'"; execute_query($escort_status_sql) or die(mysql_error()); unset($_SESSION['SH_ESCORT_ID']); ?> <script language="javascript"> window.location.href="<?php echo $SITE_URL;?>my-account.php?ad_status=success"; </script> <?php exit; } else { $error_message = $resultJson['transaction']['processing']['return']['message']. ".<br /> Please Retry."; } } $payment_sql = "SELECT ft_ad_price AS `total_payment` FROM `escort_details` WHERE id = '".$_SESSION['SH_ESCORT_ID']."' AND `status` = 'u'"; $payment_res = execute_query($payment_sql) or die(mysql_error()); $payment_row = mysql_fetch_array($payment_res); $payment = number_format($payment_row['total_payment'],2); if($sh_payment_mode == "Live") { $sh_token_url = "https://ctpe.net/frontend/GenerateToken"; $sh_SENDER = "8a829417464cdd8301464f28c5d0017b"; $sh_CHANNEL = "8a829417464cdd8301464f38bf1d01a9"; $sh_TRANSACTION_MODE = "LIVE"; $sh_USER_LOGIN = "8a829417464cdd8301464f28c5d3017f"; $sh_USER_PWD = "tD5pNg6g"; $sh_script_url = "https://ctpe.net/frontend/widget/v3/widget.js?language=en&style=plain"; } else { $sh_token_url = "https://test.ctpe.net/frontend/GenerateToken"; $sh_SENDER = "ff80808142b2c03c0142b7a7339603e0"; $sh_CHANNEL = "ff80808142b2c03c0142b7a7339803e5"; $sh_TRANSACTION_MODE = "INTEGRATOR_TEST"; $sh_USER_LOGIN = "ff8080814528396101452c261a580354"; $sh_USER_PWD = "IngoTester"; $sh_script_url = "https://test.ctpe.net/frontend/widget/v3/widget.js?language=en&style=plain"; } //Generate Token: $url = $sh_token_url; $data = "SECURITY.SENDER=" .$sh_SENDER. "&TRANSACTION.CHANNEL=" .$sh_CHANNEL. "&TRANSACTION.MODE=" .$sh_TRANSACTION_MODE. "&USER.LOGIN=" .$sh_USER_LOGIN. "&USER.PWD=" .$sh_USER_PWD. "&PAYMENT.TYPE=DB" . "&PRESENTATION.AMOUNT=" .$payment. "&PRESENTATION.CURRENCY=USD"; $params = array('http' => array( 'method' => 'POST', 'content' => $data )); $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); if (!$fp) { throw new Exception("Problem with $url, $php_errormsg"); } $response = @stream_get_contents($fp); if ($response === false) { throw new Exception("Problem reading data from $url, $php_errormsg"); } $response_array = json_decode($response); ?> <body> <style type="text/css"> .customInputField { background-color: #e9acbf; border: 1px solid #8e006f; border-radius: 5px; color: #8e006f; font-family: 'Open Sans',sans-serif; font-size: 15px; height: 31px; padding-left: 10px; width: 222px; } .brandSelectBox { background-color: #e9acbf; border: 1px solid #8e006f; border-radius: 5px; color: #8e006f; font-family: 'Open Sans',sans-serif; font-size: 15px; height: 31px; padding-left: 10px; width: 240px; } .expiryMonthSelectBox { background-color: #e9acbf; border: 1px solid #8e006f; border-radius: 5px; color: #8e006f; font-family: 'Open Sans',sans-serif; font-size: 15px; height: 31px; padding-left: 10px; width: 60px; } .expiryYearSelectBox { background-color: #e9acbf; border: 1px solid #8e006f; border-radius: 5px; color: #8e006f; font-family: 'Open Sans',sans-serif; font-size: 15px; height: 31px; padding-left: 10px; width: 100px; } .customLabel { color: #8c3274; font-family: 'Open Sans',sans-serif; font-size: 13px !important; text-align: center; width: 200px; line-height:38px; font-family:'Open Sans',sans-serif !important; } .cardSubmitButton { margin-right:70px !important; padding-top:3px !important; background-color:#AD0188; text-transform:uppercase; font-family:'Open Sans',sans-serif; } </style> <? include "includes/header.php";?> <div class="hdr_foo"> <div class="hrd_ftmenu"> </div> </div> <div class="main_bg"> <div style="height:32px;"></div> <div style="width:1000px; margin:0 auto;"> <div class="menuleft_contain"> <? include "includes/acount_leftcontent.php";?> </div> <div class="acountright_contain"> <? $sql="SELECT * FROM user_info WHERE userid='".$_SESSION['userid']."'"; $res=execute_query($sql); $row=mysql_fetch_array($res); $num=mysql_num_rows($res); ?> <div class="acccmid1_header">PAY NOW </div> <div class="accountrightct_mid"> <div class="small_space"></div> <div class="profile_data"> <p style="color:#F00; font:bold 18px/24px Arial, Helvetica, sans-serif; margin-top:50px;" align="center"> <?php echo $error_message;?></p> <script src="<?php echo $sh_script_url;?>" ></script> <form action="<?php echo $SITE_URL;?>pay_now.php" id="<?php echo $response_array->transaction->token;?>"> MASTER VISA AMEX CHINAUNIONPAY </form> <br class="spacer" /> </div> <br class="spacer" /> </div> </div> <br class="spacer" /> </div> <br/> </div> <? include "includes/footer.php";?>