-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsuccess.php
More file actions
489 lines (383 loc) · 14.9 KB
/
success.php
File metadata and controls
489 lines (383 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php
include_once ("z_db.php");
// Load the language file for messages, etc.
// Load the PHPMailer library for send mails.
session_start();
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
exit('Sorry, this script does not run on a PHP version smaller than 5.3.7!');
} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {
// If you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php
// (this library adds the PHP 5.5 password hashing functions to older versions of PHP)
//require_once('libraries/password_compatibility_library.php');
}
else
{
$msg=" Please wait we are processing your request, Do not refresh or click back on this page ";
$msg2="This may take a while....";
}
?>
<!DOCTYPE html>
<html lang="en" class="app">
<head>
<style>html {
overflow-y: scroll;
}</style>
<meta charset="utf-8" />
<title>Thank You</title>
<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="css/app.v1.css" type="text/css" />
<!--[if lt IE 9]> <script src="js/ie/html5shiv.js"></script> <script src="js/ie/respond.min.js"></script> <script src="js/ie/excanvas.js"></script> <![endif]-->
<div id="google_translate_element" align="right"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, multilanguagePage: true}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</head>
<body style="overflow: scroll;" class="">
<section id="content" class="m-t-lg wrapper-md animated fadeInDown">
<div> <a class="navbar-brand block"><?php print $msg; ?> </a>
<section class="m-b-lg">
<header class="wrapper text-center"> <strong><?php print $msg2 ?> </strong> </header>
<h3> Do not click refresh or back button, we are processing your transaction. You will be redirected automatically. If you find any error below then the transcation may have declained and you need to contact your administrator.<h3/>
<?php
if(mysqli_real_escape_string($con,$_GET['method']) == "PAYPAL") {
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
//Set up the acknowledgement request headers
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Host: www.paypal.com\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
//Open a socket for the acknowledgement request
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
// Post request back to PayPal for validation
fputs ($fp, $header . $req);
while (!feof($fp)) { // While not EOF
$res = fgets ($fp, 1024); // Get the acknowledgement response
if (strcmp ($res, "VERIFIED") == 0) { // Response is VERIFIED
$product = $_POST['item_number'];
$product_transaction = $_POST['txn_id'];
$product_price = $_POST['mc_gross'];
$product_currency = $_POST['mc_currency'];
$payment_date = $_POST['payment_date'];
$merchant = $_POST['receiver_email'];
$user = $_POST['custom'];
$query2="SELECT id,fname,email,doj,active,username,address,pcktaken,renew FROM affiliateuser where Id = '$user'";
$result2 = mysqli_query($con,$query2);
while($row2 = mysqli_fetch_array($result2))
{
$aid="$row2[id]";
$regdate="$row2[doj]";
$name="$row2[fname]";
$address="$row2[address]";
$acti="$row2[active]";
$pck="$row2[pcktaken]";
$renewstatus="$row2[renew]";
}
$query3="SELECT id,name,price,currency,tax FROM packages where id='$pck'";
$result3 = mysqli_query($con,$query3);
while($row3 = mysqli_fetch_array($result3))
{
$id="$row3[id]";
$pname="$row3[name]";
$pprice="$row3[price]";
$pcur="$row3[currency]";
$ptax="$row3[tax]";
$total=$pprice+$ptax;
}
if($pprice == $product_price && $product_currency == $pcur) {
$date = date("Y-m-d");
$result = mysqli_query($con,"SELECT count(*) FROM paypalpayments where transacid = '$product_transaction'");
$row = mysqli_fetch_row($result);
$numrows = $row[0];
if ($numrows==0)
{
$status= "OK";
}
else
{
$status="NOTOK";
}
if ($status= "OK")
{
if($renewstatus==1)
{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway,renacid,renew) values('$user','$product_transaction','$product_price','$product_currency','$payment_date','$product','Paypal','$pck',1)") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 and renew=0 WHERE id=$aid");
}
else{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway) values('$user','$product_transaction','$product_price','$product_currency','$payment_date','$product','Paypal')") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 WHERE id=$aid");
}
if(1==1)
{
$sqlquery="SELECT wlink FROM settings where sno=0"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$wlink=$row2[0]; //assigning website address
$sqlquery222="SELECT email FROM settings where sno=0"; //fetching website from databse
$rec3=mysqli_query($con,$sqlquery222);
$row222 = mysqli_fetch_row($rec3);
$email=$row222[0]; //assigning website address
$sqlquery111="SELECT etext FROM emailtext where code='NEWMEMBER'"; //fetching email text from databse
$rec2111=mysqli_query($con,$sqlquery111);
$row2111 = mysqli_fetch_row($rec2111);
$emailtext=$row2111[0]; //assigning email text for email
// More headers
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <no-reply@'.$wlink.'>' . "\r\n";
$to=$email;
$subject="New Paypal Order | Bingo ";
$message=$emailtext;
mail($to,$subject,$message,$headers);
print "
<script language='javascript'>
window.location = 'finalthankyou.php';
</script>
";
}
}
}
}
elseif (strcmp ($res, "INVALID") == 0) { // Response is INVALID
echo 'Invalid payment response, your request has been discarded, this may happen due to invalid details of payment or your ayment already processed. Contcat Administrator For more details.';
}
}
fclose ($fp);
}
elseif(mysqli_real_escape_string($con,$_GET['method']) == "PAYZA") {
define("IPN_V2_HANDLER", "https://secure.payza.com/ipn2.ashx");
define("TOKEN_IDENTIFIER", "token=");
$token = urlencode($_POST['token']);
$token = TOKEN_IDENTIFIER.$token;
$response = '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, IPN_V2_HANDLER);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $token);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
if(strlen($response) > 0) {
if(urldecode($response) != "INVALID TOKEN") {
$response = urldecode($response);
$aps = explode("&", $response);
$info = array();
foreach ($aps as $ap) {
$ele = explode("=", $ap);
$info[$ele[0]] = $ele[1];
}
$date = date("Y-m-d");
$user = $info['apc_1'];
$totalAmountReceived = $info['ap_totalamount'];
$currency = $info['ap_currency'];
$myItemCode = $info['ap_itemcode'];
$transactionDate = $info['ap_transactiondate'];
$transactionReferenceNumber = $info['ap_referencenumber'];
$query2="SELECT id,fname,email,doj,active,username,address,pcktaken,renew FROM affiliateuser where Id = '$user'";
$result2 = mysqli_query($con,$query2);
while($row2 = mysqli_fetch_array($result2))
{
$aid="$row2[id]";
$regdate="$row2[doj]";
$name="$row2[fname]";
$address="$row2[address]";
$acti="$row2[active]";
$pck="$row2[pcktaken]";
$renewstatus="$row2[renew]";
}
$query3="SELECT id,name,price,currency,tax FROM packages where id='$pck'";
$result3 = mysqli_query($con,$query3);
while($row3 = mysqli_fetch_array($result3))
{
$id="$row3[id]";
$pname="$row3[name]";
$pprice="$row3[price]";
$pcur="$row3[currency]";
$ptax="$row3[tax]";
$total=$pprice+$ptax;
}
if($pprice == $totalAmountReceived && $currency == $pcur) {
$date = date("Y-m-d");
$result = mysqli_query($con,"SELECT count(*) FROM paypalpayments where transacid = '$transactionReferenceNumber'");
$row = mysqli_fetch_row($result);
$numrows = $row[0];
if ($numrows==0)
{
$status= "OK";
}
else
{
$status="NOTOK";
}
if ($status= "OK")
{
if($renewstatus==1)
{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway,renacid,renew) values('$user','$product_transaction','$product_price','$product_currency','$payment_date','$product','Payza','$pck',1)") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 and renew=0 WHERE id=$aid");
}
else{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway) values('$user','$transactionReferenceNumber','$totalAmountReceived','$currency','$transactionDate','$myItemCode','Payza')") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 WHERE id=$aid");
}
if(1==1)
{
$sqlquery="SELECT wlink FROM settings where sno=0"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$wlink=$row2[0]; //assigning website address
$sqlquery222="SELECT email FROM settings where sno=0"; //fetching website from databse
$rec3=mysqli_query($con,$sqlquery222);
$row222 = mysqli_fetch_row($rec3);
$email=$row222[0]; //assigning website address
$sqlquery111="SELECT etext FROM emailtext where code='NEWMEMBER'"; //fetching email text from databse
$rec2111=mysqli_query($con,$sqlquery111);
$row2111 = mysqli_fetch_row($rec2111);
$emailtext=$row2111[0]; //assigning email text for email
// More headers
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <no-reply@'.$wlink.'>' . "\r\n";
$to=$email;
$subject="New Payza Order | Bingo ";
$message=$emailtext;
mail($to,$subject,$message,$headers);
print "
<script language='javascript'>
window.location = 'finalthankyou.php';
</script>
";
}
}
}
}
}
}
elseif(mysqli_real_escape_string($con,$_GET['method']) == "SOLIDTRUSTPAY") {
//$sci_pwd = $paymentProcessors['STPButtonPWD'];
$query="SELECT solidbutton FROM settings where sno=0";
$result = mysqli_query($con,$query);
while($row = mysqli_fetch_array($result))
{
$sci_pwd="$row[solidbutton]";
}
$sci_pwd = md5($sci_pwd.'s+E_a*');
$hash_received = MD5($_POST['tr_id'] . ":" . MD5($sci_pwd) . ":" . $_POST['amount'] . ":" . $_POST['merchantAccount'] . ":" . $_POST['payerAccount']);
if($hash_received == $_POST['hash']) {
$user = mysqli_real_escape_string($con,$_POST['user1']);
$trst_amount=mysqli_real_escape_string($con,$_POST['amount']);
$trst_itemid=mysqli_real_escape_string($con,$_POST['item_id']);
$trst_trid=mysqli_real_escape_string($con,$_POST['tr_id']);
$trDate=mysqli_real_escape_string($con,$_POST['date']);
$currency=mysqli_real_escape_string($con,$_POST['currency']);
$date = date("Y-m-d");
$query2="SELECT id,fname,email,doj,active,username,address,pcktaken,renew FROM affiliateuser where Id = '$user'";
$result2 = mysqli_query($con,$query2);
while($row2 = mysqli_fetch_array($result2))
{
$aid="$row2[id]";
$regdate="$row2[doj]";
$name="$row2[fname]";
$address="$row2[address]";
$acti="$row2[active]";
$pck="$row2[pcktaken]";
$renewstatus="$row2[renew]";
}
$query3="SELECT id,name,price,currency,tax FROM packages where id='$pck'";
$result3 = mysqli_query($con,$query3);
while($row3 = mysqli_fetch_array($result3))
{
$id="$row3[id]";
$pname="$row3[name]";
$pprice="$row3[price]";
$pcur="$row3[currency]";
$ptax="$row3[tax]";
$total=$pprice+$ptax;
}
if($pprice == $trst_amount && $currency == $pcur) {
$date = date("Y-m-d");
$result = mysqli_query($con,"SELECT count(*) FROM paypalpayments where transacid = 'trst_trid'");
$row = mysqli_fetch_row($result);
$numrows = $row[0];
if ($numrows==0)
{
$status= "OK";
}
else
{
$status="NOTOK";
}
if ($status= "OK")
{
if($renewstatus==1)
{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway,renacid,renew) values('$user','$product_transaction','$product_price','$product_currency','$payment_date','$product','SolidTrustPay','$pck',1)") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 and renew=0 WHERE id=$aid");
}
else{
$query=mysqli_query($con,"insert into paypalpayments(orderid,transacid,price,currency,date,pckid,gateway) values('$user','$trst_trid','$trst_amount','$currency','$trDate','$trst_itemid','SolidTrustPay')") and $query15=mysqli_query($con,"UPDATE affiliateuser SET active=1 WHERE id=$aid");
}
if(1==1)
{
$sqlquery="SELECT wlink FROM settings where sno=0"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$wlink=$row2[0]; //assigning website address
$sqlquery222="SELECT email FROM settings where sno=0"; //fetching website from databse
$rec3=mysqli_query($con,$sqlquery222);
$row222 = mysqli_fetch_row($rec3);
$email=$row222[0]; //assigning website address
$sqlquery111="SELECT etext FROM emailtext where code='NEWMEMBER'"; //fetching email text from databse
$rec2111=mysqli_query($con,$sqlquery111);
$row2111 = mysqli_fetch_row($rec2111);
$emailtext=$row2111[0]; //assigning email text for email
// More headers
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <no-reply@'.$wlink.'>' . "\r\n";
$to=$email;
$subject="New SolidTrustPay Order | Bingo ";
$message=$emailtext;
mail($to,$subject,$message,$headers);
print "
<script language='javascript'>
window.location = 'finalthankyou.php';
</script>
";
}
}
}
}
}
elseif($_GET['method'] == " ")
{
print "Invalid parameters";
}
?>
</section>
</div>
</section>
<!-- footer -->
<footer id="footer">
<div class="text-center padder clearfix">
<p> <small><?php $query="SELECT footer from settings where sno=0";
$result = mysqli_query($con,$query);
while($row = mysqli_fetch_array($result))
{
$footer="$row[footer]";
print $footer;
}
?></small> </p>
</div>
</footer>
<!-- / footer -->
<!-- Bootstrap -->
<!-- App -->
<script src="js/app.v1.js"></script>
<script src="js/app.plugin.js"></script>
</body>
</html>