Script PaymentWall
#61

i think that code is missing an <? at the start am i right?

but when i just add the <? at the start it tells:

PHP Parse error: syntax error, unexpected '}' in C:\**\****\******\*****\****\****.php on line 7

#62

Any1 knows about that one?

 

<?phperror_reporting(E_ALL);

ini_set('display_errors', '1');

 

include '../Site_Settings/configuration.php';

 

$ip = $_SERVER['REMOTE_ADDR'];

 

$allowIP[0] = '174.36.92.186';

$allowIP[1] = '174.36.96.66';

$allowIP[2] = '174.36.92.187';

$allowIP[3] = '174.36.92.192';

$allowIP[4] = ''174.37.14.28;

 

 

if( in_array($ip, $allowIP) )

{

 

function Sanitize($data)

{

 

// remove whitespaces (not a must though)

$data = trim($data);

 

// apply stripslashes if magic_quotes_gpc is enabled

if(get_magic_quotes_gpc())

{

$data = stripslashes($data);

}

 

// a mySQL connection is required before using this function

$data = mysql_real_escape_string($data);

 

return $data;

}

 

function BanUser($uid, $reason)

{

include '../site_settings/configuration.php';

$mysql = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("UPDATE t_users SET a_enable = 0 WHERE a_portal_index = '". $uid ."'") or die( mysql_error() );

$mysql = mysql_select_db( $SiteSQL["config-database_site"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("INSERT INTO t_banlist (a_user_index, a_timestamp, a_reason, a_admin_name, a_action)

VALUES ('". $uid ."','". time() ."','". $reason ."','Paymentwall','BAN')") or die( mysql_error() );

}

 

function AddCash($uid, $amount, $ref)

{

include '../site_settings/configuration.php';

$mysql = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("UPDATE newproject_db_auth.bg_user SET cash = cash + ". $amount ." WHERE user_code = '". $uid ."'") or die( mysql_error() );

$mysql = mysql_select_db( $SiteSQL["config-database_site"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("INSERT INTO t_donate_log (a_user_index, a_timestamp, a_points, a_gm, a_ref)

VALUES('". $uid ."','".time()."','". $amount ."','Paymentwall','". $ref ."')") or die( mysql_error() );

}

 

function RemCash($uid, $amount, $ref)

{

include '../site_settings/configuration.php';

$mysql = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("UPDATE bg_user SET cash = cash + ". addslashes( $amount )." WHERE user_code = '". addslashes( $uid ) ."'") or die( mysql_error() );

$mysql = mysql_select_db( $SiteSQL["config-database_site"] , $Site_sqlcon) or die( mysql_error() );

$result = mysql_query("INSERT INTO t_donate_log (a_user_index, a_timestamp, a_points, a_gm, a_ref)

VALUES('". $uid ."','".time()."','". $amount ."','Paymentwall','". $ref ."')") or die( mysql_error() );

}

 

 

$mysql = mysql_select_db( $SiteSQL["config-database_site"] , $Site_sqlcon) or die( mysql_error() );

$result22 = mysql_query("SELECT a_secretkey from t_settings WHERE a_index = 1");

$key = mysql_fetch_array( $result22 );

 

$secretKey = $key['a_secretkey'];

 

$uid = Sanitize( $_GET['uid'] );

$currency = Sanitize( $_GET['currency'] );

$type = Sanitize( $_GET['type'] );

$ref = Sanitize( $_GET['ref'] );

$sig = Sanitize( $_GET['sig'] );

 

$pingback = 1;

$mysql = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );

$query = sprintf("SELECT count(*) FROM bg_user WHERE user_code = '%s';", $uid);

$result = mysql_query($query) or die( mysql_error() );

$r = mysql_fetch_row( $result );

 

if( $r[0] == 1 )

{

 

 

if( $type == 0 || $type == 1 ) // Add cash

{

AddCash($uid, $currency, $ref);

echo 'OK';

}

 

 

// --> Chargeback

elseif( $type == 2 )

{

 

$reason = $_GET['reason'];

 

switch( $reason )

{

case 1:

BanUser($uid,'Chargeback',$ref);

break;

case 2:

BanUser($uid,'Credit Card fraud',$ref);

break;

case 3:

BanUser($uid,'Order fraud',$ref);

break;

case 4:

BanUser($uid,'Bad data entry',$ref);

break;

case 5:

BanUser($uid,'Fake / proxy user',$ref);

break;

case 6:

BanUser($uid,'Rejected by advertiser',$ref);

break;

case 7:

BanUser($uid,'Duplicate conversions',$ref);

break;

case 8:

BanUser($uid,'Goodwill credit taken back',$ref);

break;

case 9:

BanUser($uid,'Cancelled order',$ref);

break;

case 10:

BanUser($uid,'Partially reversed transaction',$ref);

break;

 

 

 

}

 

RemCash($uid, $currency);

echo 'OK';

 

 

}

// <---

 

 

 

}

else

{

echo 'Not found user '. $uid;

}

 

 

}

else

{

echo 'NO Access : ' . $_SERVER['REMOTE_ADDR'];

}

 

?>

 

well this it what happens:

Pingback wasn't successful. Reason: HTTP status code is different from 200

 

HTTP/1.0 500 Internal Server Error

Content-type: text/html

Server: Microsoft-IIS/7.5

X-powered-by: ASP.NET

X-powered-by-plesk: PleskWin

Date: Fri, 24 Aug 2012 12:57:13 GMT

Content-length: 1410

Connection: close

 

<HTML>

<HEAD>

<TITLE>500 Internal Server Error</TITLE>

</HEAD><BODY>

<H1>Internal Server Error</H1>

The server encountered an internal error or

misconfiguration and was unable to complete

your request.<P>

Please contact the server administrator to inform of the time the error occurred

and of anything you might have done that may have

caused the error.<P>

More information about this error may be available

in the server error log.<P>

<HR>

<ADDRESS>

Web Server at ******

</ADDRESS>

</BODY>

</HTML>

 

<!--

- Unfortunately, Microsoft has added a clever new

- "feature" to Internet Explorer. If the text of

- an error's message is "too small", specifically

- less than 512 bytes, Internet Explorer returns

- its own error message. You can turn that off,

- but it's pretty tricky to find switch called

- "smart error messages". That means, of course,

- that short error messages are censored by default.

- IIS always returns error messages that are long

- enough to make Internet Explorer happy. The

- workaround is pretty simple: pad the error

- message with a big comment like this to push it

- over the five hundred and twelve bytes minimum.

- Of course, that's exactly what you're reading

- right now.

-->

#63

I get this error all the time:

HTTP/1.0 404 Not Found
Content-type: text/html
Server: Microsoft-IIS/7.5
Date: Fri, 24 Aug 2012 20:37:32 GMT
Content-length: 1245
Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>404 - File or directory not found.</h2>
<h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
</fieldset></div>
</div>
</body>
</html>

 

Now i found the problem, saved as wrong file..^^ now i saved it right but again error:

"Pingback wasn't successful. Reason: Response body does not match the expected pattern: OK"

 

HTTP/1.0 200 OK
Content-type: text/html
Server: Microsoft-IIS/7.5
X-powered-by: PHP/5.3.15
Date: Fri, 24 Aug 2012 20:44:15 GMT
Content-length: 10311
Connection: close

prepare( $query );

$dbh->execute( array( ':uid' => $uid ));

}

// Add the cash to the account.
// In case of a drawback or fraud paymentwall deletes the cash also
// But since they use a negative amount, this will work perfectly
function SetCash($uid, $amount)
{
global $dbs, $db;

$query = sprintf
("
UPDATE %s.bg_user
SET cash = cash + :amount
WHERE user_code = :uid

", $dbs['user_dbase'] );

$dbh = $db->prepare( $query );

$dbh->execute( array( ':amount' => $amount,
':uid' => $uid ));

}

// Function to check if the user exists
function CheckUserExist( $uid )
{
global $dbs, $db;

$query = sprintf
("
SELECT count(*)
FROM %s.bg_user
WHERE user_code = :uid

", $dbs['user_dbase'] );

$dbh = $db->prepare( $query );

$dbh->execute( array( ':uid' => $uid ));

$result = $dbh->fetch();

if( $result[0] == 1 )
return true;
else
return false;
}

$uid = $_GET['uid'];
$currency = $_GET['currency'];
$type = $_GET['type'];
$ref = $_GET['ref'];
$sig = $_GET['sig'];

// Check the incomming data
if( !ctype_digit( $uid ) )
echo 'UID: ' . htmlspecialchars( $uid ) . ' is not a number';

elseif( !is_numeric( $currency ) )
echo 'Currency: ' . htmlspecialchars( $currency ) . ' is not a number';

elseif( !ctype_digit( $type ) )
echo 'Type: ' . htmlspecialchars( $type ) . ' is not a number';

elseif( !ctype_alnum($ref) )
echo 'Reference: ' . htmlspecialchars( $ref ) . ' can only contain 0-9 a-Z';

elseif( !ctype_alnum($sig) )
echo 'Signature: ' . htmlspecialchars( $sig ) . ' can only contain 0-9 a-Z';

else
{

// See if the userid exists
if( CheckUserExist( $uid ) )
{

// Add the cash to the user
if( $type == 0 || $type == 1 )
{
SetCash($uid, $currency);
echo 'OK';
}

// Chargeback or Fraud
elseif( $type == 2 )
{

$reason = $_GET['reason'];

switch( $reason )
{
case 1:
BanUser($uid,'Chargeback');
break;
case 2:
BanUser($uid,'Credit Card fraud');
break;
case 3:
BanUser($uid,'Order fraud');
break;
case 4:
BanUser($uid,'Bad data entry');
break;
case 5:
BanUser($uid,'Fake / proxy user');
break;
case 6:
BanUser($uid,'Rejected by advertiser');
break;
case 7:
BanUser($uid,'Duplicate conversions');
break;
case 8:
BanUser($uid,'Goodwill credit taken back');
break;
case 9:
BanUser($uid,'Cancelled order');
break;
case 10:
BanUser($uid,'Partially reversed transaction');
break;

}

// Remove the cash
SetCash($uid, $currency);
echo 'OK';

}
else
echo 'Unknown type : ' . htmlspecialchars( $type );
}
else
echo 'Not found user : ' . htmlspecialchars($uid);
}
}
else
echo 'IP Unknown : ' . $ip;

?>

#64
link donwload

#65


I get this error all the time:

HTTP/1.0 404 Not Found
Content-type: text/html
Server: Microsoft-IIS/7.5
Date: Fri, 24 Aug 2012 20:37:32 GMT
Content-length: 1245
Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>404 - File or directory not found.</h2>
<h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
</fieldset></div>
</div>
</body>
</html>

 

Now i found the problem, saved as wrong file..^^ now i saved it right but again error:

"Pingback wasn't successful. Reason: Response body does not match the expected pattern: OK"

 

HTTP/1.0 200 OK
Content-type: text/html
Server: Microsoft-IIS/7.5
X-powered-by: PHP/5.3.15
Date: Fri, 24 Aug 2012 20:44:15 GMT
Content-length: 10311
Connection: close

prepare( $query );

$dbh->execute( array( ':uid' => $uid ));

}

// Add the cash to the account.
// In case of a drawback or fraud paymentwall deletes the cash also
// But since they use a negative amount, this will work perfectly
function SetCash($uid, $amount)
{
global $dbs, $db;

$query = sprintf
("
UPDATE %s.bg_user
SET cash = cash + :amount
WHERE user_code = :uid

", $dbs['user_dbase'] );

$dbh = $db->prepare( $query );

$dbh->execute( array( ':amount' => $amount,
':uid' => $uid ));

}

// Function to check if the user exists
function CheckUserExist( $uid )
{
global $dbs, $db;

$query = sprintf
("
SELECT count(*)
FROM %s.bg_user
WHERE user_code = :uid

", $dbs['user_dbase'] );

$dbh = $db->prepare( $query );

$dbh->execute( array( ':uid' => $uid ));

$result = $dbh->fetch();

if( $result[0] == 1 )
return true;
else
return false;
}

$uid = $_GET['uid'];
$currency = $_GET['currency'];
$type = $_GET['type'];
$ref = $_GET['ref'];
$sig = $_GET['sig'];

// Check the incomming data
if( !ctype_digit( $uid ) )
echo 'UID: ' . htmlspecialchars( $uid ) . ' is not a number';

elseif( !is_numeric( $currency ) )
echo 'Currency: ' . htmlspecialchars( $currency ) . ' is not a number';

elseif( !ctype_digit( $type ) )
echo 'Type: ' . htmlspecialchars( $type ) . ' is not a number';

elseif( !ctype_alnum($ref) )
echo 'Reference: ' . htmlspecialchars( $ref ) . ' can only contain 0-9 a-Z';

elseif( !ctype_alnum($sig) )
echo 'Signature: ' . htmlspecialchars( $sig ) . ' can only contain 0-9 a-Z';

else
{

// See if the userid exists
if( CheckUserExist( $uid ) )
{

// Add the cash to the user
if( $type == 0 || $type == 1 )
{
SetCash($uid, $currency);
echo 'OK';
}

// Chargeback or Fraud
elseif( $type == 2 )
{

$reason = $_GET['reason'];

switch( $reason )
{
case 1:
BanUser($uid,'Chargeback');
break;
case 2:
BanUser($uid,'Credit Card fraud');
break;
case 3:
BanUser($uid,'Order fraud');
break;
case 4:
BanUser($uid,'Bad data entry');
break;
case 5:
BanUser($uid,'Fake / proxy user');
break;
case 6:
BanUser($uid,'Rejected by advertiser');
break;
case 7:
BanUser($uid,'Duplicate conversions');
break;
case 8:
BanUser($uid,'Goodwill credit taken back');
break;
case 9:
BanUser($uid,'Cancelled order');
break;
case 10:
BanUser($uid,'Partially reversed transaction');
break;

}

// Remove the cash
SetCash($uid, $currency);
echo 'OK';

}
else
echo 'Unknown type : ' . htmlspecialchars( $type );
}
else
echo 'Not found user : ' . htmlspecialchars($uid);
}
}
else
echo 'IP Unknown : ' . $ip;

?>

 

same here -.-'

#66

Unfortunately, based on the feedback of our Risk Team we are unable to serve your application.

 

Well idk what they are tellin about xD anyone knows what to do?

#67

Unfortunately, based on the feedback of our Risk Team we are unable to serve your application.

 

Same problem....

#68
This Code is Crap is have a big bug.

#69

when i will do pingback at paymentwall.com i get this error:

Pingback wasn't successful. Reason: Response body does not match the expected pattern: OK

what i made wrong?

#70
I greet you, I need your help on this subject. Could someone explain to me exactly step by step how to do it properly as it should?



Forum Jump:


Users browsing this thread: 2 Guest(s)