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

    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock