Jump to content
  • 0

[REQUEST]SCRIPT


Question

Posted

 

Here is the script for http://2pay.pro/!But for some reason it does not wanna work!

Can somebody look at this code,and see if something is wrong!

It is not coded by me,i found it on some forum!

If somebody could get this working it would really help many users of this forum to have good donation system!

As they have over 60 payment options!

----------------------------------------------------------------------------------------------------------------------------

<?php

 

//

//

 

 

header( 'Content-type: text/xml' );

//Ип адреса, с которых будет приходить запрос. Для защиты.

$check_ip[]="82.146.40.60";

$check_ip[]="188.120.245.101";

$check_ip[]="188.120.245.102";

    $date=date("d.m.y");

//======================================настройки============================================

// Секретный ключ

$secret_key = "your-secret-key";

// Переменные для подключения к базе данных, впишите те, которые использовали при установке базы данных

$server='localhost';

$user='user';

$pass='password';

$db='l2jdb';

//===========================================================================================

    $flag = $_REQUEST['command'];

    $md5 = $_REQUEST['md5'];

 

// Идентификатор платежа

$v1 = $_REQUEST['v1'];

 

 

if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;

$kod=1;

 

// Проверка ип

if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

 

// Подключение к базе данных

mysql_connect($server, $user, $pass) or die("Can't connect to database");

mysql_select_db($db) or die("Can't select database ".$db);

 

// Если статус запрос

if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {

// Поиск персонажа

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$rows = mysql_num_rows($sql);

if ($rows > 0) {

$kod=0;

$desc='Character exists';

} else {

$kod=1;

$desc='Character not found';

}

} else {

  // Если команда на платеж

if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

 

$sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");

$rows = mysql_num_rows($sql);

                // Если платеж был проведен ранее

if ($rows > 0)

{

$kod=0;

$desc='Payment was send earlier';

} else

{  // Иначе пытаемся провести платеж

 

$item_count=$_REQUEST['sum']; // Количество монет для зачисления, полученное в запросе

 

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$character=mysql_fetch_array($sql);

$account_ref=$character['account_name'];

 

                    // Если персонаж найден

if(mysql_num_rows($sql)==1) {

// Добавляем персонажу количество купленных монет

$sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());

// Указываем таблицу для даты, суммы, и айди платежа ее я залил вместе со скриптом

$sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");

 

 

$kod=0;

    $desc="ok";

} else

{

$kod=2;

    $desc="Character not found";

}

}

} else

{  // // Обработка исключения: если не совпал md5 или неизвестный запрос

$kod=2;

$desc="Unknown request or account not found";

}

}

} else { $desc="Parametrs or IP is not correct"; }

// Ответ

    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else

    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }

echo $html;

?>

5 answers to this question

Recommended Posts

  • 0
Posted

<?php

 

//

//

 

 

header( 'Content-type: text/xml' );

//IP ADDRESS WHICH WILL SEND REQUEST.FOR SECURITY REASON

$check_ip[]="82.146.40.60";

$check_ip[]="188.120.245.101";

$check_ip[]="188.120.245.102";

    $date=date("d.m.y");

//======================================SETUP============================================

// SECRET KEY

$secret_key = "&f:GI1+v0[|IX%Y?#L.DXg+|i]?N!zXe";

// MYSQL DETAILS

$server='localhost';

$user='user';

$pass='password';

$db='l2jdb';

//===========================================================================================

    $flag = $_REQUEST['command'];

    $md5 = $_REQUEST['md5'];

 

// PAYMENT IDENTICIFATION KEY

$v1 = $_REQUEST['v1'];

 

 

if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;

$kod=1;

 

// IP CHEK

if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

 

// CONNECTING TO DATABASE

mysql_connect($server, $user, $pass) or die("Can't connect to database");

mysql_select_db($db) or die("Can't select database ".$db);

 

// IF REQUEST STATUS

if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {

// FINDING CHARACTER

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$rows = mysql_num_rows($sql);

if ($rows > 0) {

$kod=0;

$desc='Character exists';

} else {

$kod=1;

$desc='Character not found';

}

} else {

  // If command for payment

if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

 

$sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");

$rows = mysql_num_rows($sql);

                // If payment was made before

if ($rows > 0)

{

$kod=0;

$desc='Payment was send earlier';

} else

{  // Trying to make payemnt

 

$item_count=$_REQUEST['sum']; // Ammount of rewards

 

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$character=mysql_fetch_array($sql);

$account_ref=$character['account_name'];

 

                    // IF CHARACTER NOT FOUND

if(mysql_num_rows($sql)==1) {

// SENDING REWARD TO CHARACTER

$sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());

// TABLE TO SHOW DATE/TIME/SUM of payment

$sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");

 

 

$kod=0;

    $desc="ok";

} else

{

$kod=2;

    $desc="Character not found";

}

}

} else

{  // // Exception,if MD5 is wrong or wrong request was sent

$kod=2;

$desc="Unknown request or account not found";

}

}

} else { $desc="Parametrs or IP is not correct"; }

// Ответ

    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else

    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }

echo $html;

?>

 

----------------------------------------------------------------------------------------------------------------

Here it is with english comments!

This is automatic payment script,using system 2pay.pro!

Players pay money and get rewards!

But for some reason i can not get it to work!

It is really good payment system!

  • 0
Posted
<?php

// 
// 


   header( 'Content-type: text/xml' );
//IP ADDRESS WHICH WILL SEND REQUEST.FOR SECURITY REASON
   $check_ip[]="82.146.40.60";
   $check_ip[]="188.120.245.101";
   $check_ip[]="188.120.245.102";
    $date=date("d.m.y");
//======================================SETUP============================================
// SECRET KEY
   $secret_key = "&f:GI1+v0[|IX%Y?#L.DXg+|i]?N!zXe";
// MYSQL DETAILS
   $server='localhost';
   $user='user';
   $pass='password';
   $db='l2jdb';
//===========================================================================================
    $flag = $_REQUEST['command'];
    $md5 = $_REQUEST['md5'];

// PAYMENT IDENTICIFATION KEY
   $v1 = $_REQUEST['v1'];


   if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;
   $kod=1;

// IP CHEK
   if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

// CONNECTING TO DATABASE
   mysql_connect($server, $user, $pass) or die("Can't connect to database");
   mysql_select_db($db) or die("Can't select database ".$db);

      // IF REQUEST STATUS
      if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {
         // FINDING CHARACTER
         $sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");
         $rows = mysql_num_rows($sql);
         if ($rows > 0) {
            $kod=0;
            $desc='Character exists';
         } else {
            $kod=1;
            $desc='Character not found';
         }
      } else {
         // If command for payment
         if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

            $sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");
            $rows = mysql_num_rows($sql);
                // If payment was made before
            if ($rows > 0)
            {
               $kod=0;
               $desc='Payment was send earlier';
            } else
            {   // Trying to make payemnt

               $item_count=$_REQUEST['sum']; // Ammount of rewards

               $sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");
               $character=mysql_fetch_array($sql);
               $account_ref=$character['account_name'];

                    // IF CHARACTER NOT FOUND
               if(mysql_num_rows($sql)==1) {
               // SENDING REWARD TO CHARACTER
                  $sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());
               // TABLE TO SHOW DATE/TIME/SUM of payment
                  $sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");


                  $kod=0;
                   $desc="ok";
               } else
               {
                  $kod=2;
                   $desc="Character not found";
               }
            }
         } else
         {   // // Exception,if MD5 is wrong or wrong request was sent
            $kod=2;
            $desc="Unknown request or account not found";
         }
      }
   } else {      $desc="Parametrs or IP is not correct";   }
// Ответ
    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else
    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }
   echo $html;
?>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • I'm looking for someone to remove GameGuard from a game that uses XTRAP. The game no longer uses XTRAP. I have a game server. But the client is kicked from the game after a few minutes of logging in. If I try to remove XTRAP (just by deleting it), the game opens and closes quickly.   Send me a PM. The game is Audition, a dance game.
    • 🎉 L2Dead StuckSub - GRAND OPENING 14 February 2026🎉 After beta, testing, mistakes, laughs and a lot of PvP, the moment has finally come. L2Dead StuckSub is officially opening its gates on 14 February 2026.   ⚔️What to expect: ✦Main Class +6 Stuck Sub system ✦Balanced PvP & custom party farm areas ✦Custom events, bosses and strong rewards ✦Competitive clan scene with castle rewards   📌Until the opening: ✦Create your clans and register them in the Clan-Register channel ✦Invite your friends / old parties / CPs ✦Stay tuned for more information (rates, events, siege times, etc.)   Get your setups ready, prepare your macros and your Discord/voice. On 14 February 2026 20:00 GMT+2, we write the first chapter of L2Dead together. 🔥 https://www.l2dead.com/ https://discord.gg/TGnATuZmdt
    • Please read our rules and include price on your thread.
    • - Main Sorc with 3 more subclasses [ bishop,necromancer,warlock] - MA Robe +3 - DK +5556 - Som +4 [ Active : Stone ] - AM RAR +3 with 150 DARK ATT - Arcana Sigil Shield - Jewels - Replica Orfen x2 Zaken Core Ant Queen x2 - Tatteosian Necklase +3 - Olf +8 / Clock +7 - 4 Top Talismans which you can combain in 1 Gold Talisman Fire wings and Gold Costume Clothes You can check item's here .......
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..