A Project for Chronicle 4 based on L2JServer.


    PayGol auto donation manager

    Share

    Neeeeeeeeeel.-

    Posts : 44
    Join date : 2014-01-04
    Location : Argentina

    PayGol auto donation manager

    Post  Neeeeeeeeeel.- on 11th January 2014, 03:09

    Well, this is not exactly gameplay related buut there is no a better section:p

    I saw a paygol script that only handles an http request & it updates the items table, but that's wrong because if the player is online and he trade/drop/use any item after he make the donation (& before he relogs) the donation won't arrive. So I decided to make a good script.

    ¿What are the differences between the script I saw?
    -I used mysqli object with prepared statements instead of mysql_* functions because they are deprecated.
    -It only update the items table if the player is offline (the script checks if the player is offline every 10 minutes by default).
    -Transaction log, payment date, the date when the donation arrived & error handler.
    -Multi-item support. You can set more than 1 item for one donation (different itemid's).
    -Anti flood (in case someone wants to bother you).
    -If the playername doesn't exists the donation is saved into a table with an error but is never deleted (in case you found the owner you can just change the name, obj_id & proccesed columns manually and it will be proccesed again on next check).

    Installation

    Upload all the files to your website (except button-sample.html).
    Open config.php & configure mysql credentials and donation items.

    You will find 2 arrays, you can set there the itemids you want to give (there is no limit here).

    You will need your paygol service ID.
    Open button-sample.html
    Change your serviceID.
    Find the input called custom and change type='hidden' to type='text' so your players can write their charnames there.

    Now paste button-sample.html code where you want the donation form:D

    Create this table in you server datebase
    Code:
    CREATE TABLE `donaciones_sms` (
      `id` int(11) unsigned NOT NULL auto_increment,
      `obj_id` int(11) unsigned default NULL,
      `char_name` varchar(35) default NULL,
      `procesada` int(1) NOT NULL default '0',
      `fecha_creado` timestamp NOT NULL default CURRENT_TIMESTAMP,
      `fecha_procesado` timestamp NULL default NULL,
      `itemid` text,
      `cantidad` text,
      `error` int(1) NOT NULL default '0',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

    Finally you MUST create a CRON job (how to make a cron job) that runs paygol.php?accion=procesar every 10 minutes.

    Error 1 means character not found.
    Error 2 means that not stackeable item tryied to be given. (No sopport for no stackeable items). If you have set 3 items & only one wasn't stackeable, although you have error 2 other 2 items were given succesfully.

    Mirror 1
    Mirror 2
    Mirror 3

    I will post one for paypal when I code it for my server...

      Current date/time is 26th September 2017, 11:56