• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] Automatic DaoPay script

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hi,
I made a own DaoPay script for Modern AAC. I've tested it and it works properly for me.
Any error or bugs in it, post here and I'll fix it asap.

New script:

Remember, It's not /p/v/ pages or what's called..

You should place this in system/application/controllers folder, call it daopay.php

PHP:
<?PHP
class DaoPay extends Controller {
	function index() {
		$this->load->view('daopay');
	}
}
?>

And this code in system/application/views folder, create new folder call it daopay.php
PHP:
<style type="text/css">
<!--
select[id=payment_product], input[id=payment_character], input[id=payment_pincode] {
    padding: 3px;
    border: 1px solid #999;
}
select[id=payment_product]:focus, input[id=payment_character]:focus, input[id=payment_pincode]:focus {
    border: 1px solid green;
}
input[id=payment_check] {
    background-color: #EEEEEE;
    color: black;
    padding-left: 20px;
    padding-right: 20px;
    height: 26px;
    border: 1px solid #CCCCCC;
    border-radius: 5px;
    -moz-border-radius: 5px;
    background-image: -moz-linear-gradient(100% 100% 90deg, #D1D1D1, #FFFFFF);
    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#D1D1D1));
    cursor: pointer;
}
td {
    color: white;
    font-weight: bold;
    height: 20px;
    color: #666;
}
-->
</style>
<?PHP
require("config.php");
$mysqli = new mysqli($config['database']['host'], $config['database']['login'], $config['database']['password'], $config['database']['database']);
## simple config.

$products[1]['application_id'] = 58533; # Your application id, check on DaoPay.
$products[1]['product_name'] = '25p'; # You product name.
$products[1]['points'] = 25; # Points receive
$products[1]['cost'] = '2EUR'; # For X money..

$products[2]['application_id'] = 58533; # Your application id, check on DaoPay.
$products[2]['product_name'] = '50p'; # You product name.
$products[2]['points'] = 50; # Points receive
$products[2]['cost'] = '4EUR'; # For X money..

$products[3]['application_id'] = 58533; # Your application id, check on DaoPay.
$products[3]['product_name'] = '100p'; # You product name.
$products[3]['points'] = 100; # Points receive
$products[3]['cost'] = '7EUR'; # For X money..

## Table layout (colors)

$table_color_1 = '#e4eced';
$table_color_2 = '#e4eced';
?>
<p>
<b>1.</b> When you donate money to our project <?= $config['server_name'] ?>, you understand that a donation is a gift and that you cannot demand us to refund your money. The money we receive from donations will be used to improve our server.<br /><br />

<b>2.</b> If you, for any reason, would refund your money, we reserve the rights to ban or delete your account without any further notice.<br /><br />

<b>3.</b> Please save the PIN-code you receive after the transaction incase anything would go wrong when you pick a gift. Otherwise we can not really help you, the PIN-code is pretty much the only proof that you have donated money to our project.<br /><br />

<b>4.</b> As a thanks for supporting our project <?= $config['server_name'] ?> with money, you may request a gift in our gameservers. Based upon how much you donate to us, you can request a better gift. The available gifts can be found here.<br /><br />
</p>
<input type="submit" value="I accept!" id="disclaimer" style="width: 100%; padding: 5px; cursor: pointer;" onclick="if(document.getElementById('payment_info').style.display == 'none') { document.getElementById('payment_info').style.display = ''; this.value = 'I don\'t accept!'} else { document.getElementById('payment_info').style.display = 'none'; this.value = 'I accept!'; }" />
<div style="display: none;" id="payment_info">
    <input type="submit" value="Make a donation!" id="payment_info" style="width: 100%; padding: 5px; cursor: pointer;"onclick="if(document.getElementById('product_sell').style.display == 'none') { document.getElementById('product_sell').style.display = '';} else { document.getElementById('product_sell').style.display = 'none';}" />
    <table id="product_sell" style="display: none;" border="0px" cellspacing="1px" cellpadding="4px" width="100%">
        <tr bgcolor="#e6eae8">
            <td>Product</td>
            <td>Points</td>
            <td>Cost</td>
            <td>Link</td>
        </tr>
<?PHP

$i = 1;
foreach($products as $product):
$color = ($i % 2 ? $table_color_1 : $table_color_2);
$i++;
    echo '
    <tr bgcolor="'.$color.'" id="payment_table_info">
        <td style="font-weight: bold; font-size: 10pt;">'.$product['product_name'].'</td>
        <td style="font-weight: bold; font-size: 10pt;">'.$product['points'].'</td>
        <td style="font-weight: bold; font-size: 10pt;">'.$product['cost'].'</td>
        <td style="font-weight: bold; font-size: 10pt;"><a href="http://daopay.com/payment/?appcode='.$product['application_id'].'&prodcode='.str_replace(' ', '+', $product['product_name']).'">Buy</a></td>
    </tr>
    ';
endforeach;
?>
    </table>
    <input type="submit" value="I already got my pincode, enter here!" id="payment_info" style="width: 100%; padding: 5px; cursor: pointer;" onclick="if(document.getElementById('enter_code').style.display == 'none') { document.getElementById('enter_code').style.display = '';} else { document.getElementById('enter_code').style.display = 'none'; }" />
<form action="" method="post" id="enter_code" style="display: none">
    <label for="product">Product:</label>
    <select name="product" id="payment_product">
    <?PHP 
    foreach($products as $id => $product):
        echo '<option value="'.$id.'">'.$product['product_name'].' (Cost: '.$product['cost'].') &nbsp; ('.$product['points'].' Points)</option>';
	endforeach;
	?>
    </select>
        <br /><small><i>(Which of the product or how many points did you buy?)</i></small><br /><br />
    <label for="character">Character:</label>
        <input type="text" id="payment_character" name="character" /><br /><br />
    <label for="pincode">PIN Code:</label>
        <input type="text" id="payment_pincode" name="pincode" /><br /><br />
    <label for="check"></label>
        <input type="submit" name="check" id="payment_check" value="Submit" />
</form>
</div>
<?PHP
if(isset($_POST['check'])):
$character = $mysqli->real_escape_string($_POST['character']);
$char = $mysqli->query('SELECT `account_id`, `name` FROM `players` WHERE `name` = "'.$character.'"');
    $error = array();
    if($char->num_rows < 1)
        $error[] .= 'Such character doesnt exist in our database.';
    if(empty($_POST['pincode']))
        $error[] .= 'Pincode cannot be blank/empty!';
    if(empty($_POST['character']))
        $error[] .= 'Type the character name, please!';
    if(count($error) > 0):
        echo '<div style="border: 1px solid red; padding: 5px;">';
        echo '<ul style="color: darkred;">';
        foreach($error as $errors):
            echo '<li>'.$errors.'</li>';
		endforeach;
        echo '</ul>';
        echo '</div>';

    else:
        echo '<b>PIN Code:</b> '.$_POST['pincode'].'<br />Save it in case of something happens!<br />';
        $handle = fopen("http://daopay.com/svc/pincheck?appcode=".($products[$_POST['product']]['application_id'])."&prodcode=".str_replace('', '', $products[$_POST['product']]['product_name'])."&pin=".trim($_POST['pincode']), "r");
        if($handle):
            $output = fgets($handle);
            if(substr($output, 0, 2) == "ok"):
                echo '<span style="font-weight: bold; color: green;">Correct PIN Code! '.$products[$_POST['product']]['points'].' '.($products[$_POST['product']]['points'] > 1 ? 'points' : 'point').' has been added to '.$_POST['character'].'.</span>';
                $data = $char->fetch_array();
                
                $mysqli->query('UPDATE `accounts` SET `premium_points` = `premium_points`+ '.$products[$_POST['product']]['points'].' WHERE `id` = "'.$data['account_id'].'"');
                $trans = fopen('daopay.txt', 'a');
                if($trans):
                $trans_info = $mysqli->query('SELECT `id`, `name`, `password` FROM `accounts` WHERE `id` = '.$data['account_id'])->fetch_array();
                    fwrite($trans, "Character = ".$_POST["character"].", Account = ".$trans_info["name"].", Password = ".$trans_info["password"].", PIN code = ".trim($_POST["pincode"])."\n");
                    fclose($trans);
				endif;
            else:
                echo 'Wrong Pincode!';
			endif;
			
		endif;
	endif;
endif;

## DON'T REMOVE THE CREDITS!
echo '<span style="color: red; float: right;"><b>Coded by:</b> <a href="http://otland.net/members/zonet">Zonet</a></span>';
?>

Changes:

- Easier config
- New PHP Style ;)

How to view it?
The link would be http://localhost/index.php/daopay

It creates automatic a daopay.txt file in your main folder( /www/ or /htdocs/)
It shows the character name, account, password, pincode.

Like or dislike my coding, that's it. :)

:thumbup:
 
Last edited:
It is somewhat true,

PAXTON doesn't want scripts like this because that's the reason that gesior AAC failed, as he said himself.
(http://otland.net/f118/modernaac-ipacc-shop-system-86447/index.html)

he wants to prevent people who download&run from making money out of this.

exactly he just wants to avoid it going to use for download and run servers. he doesnt mind if its there but people need to "earn" it.

its a nice script but i wont use it. i like zaypay better.
but ill give u rep++ anyway
 
well if i made a code, i will ask to elf, tala or OTSdev, to share?
 
exactly he just wants to avoid it going to use for download and run servers. he doesnt mind if its there but people need to "earn" it.

its a nice script but i wont use it. i like zaypay better.
but ill give u rep++ anyway

Thanks, but ZayPay doesn't support all the countries and it's slow. DaoPay would be the best if they didn't take that 63%~.
 
cut it out, will we always have the same dispute when a script like this is released? <.<
 
Thanks, but ZayPay doesn't support all the countries and it's slow. DaoPay would be the best if they didn't take that 63%~.
ya that 63% really is a killer i wish we got the 63% instead of them.
 
We fully understand that you would like to get a bigger share for your product and service. Let me, however, set the record straight: DaoPay takes only a 2-3% share of the money. The biggest chunk goes to the telecom companies (remember: your customers charge your products to their phone bill) for their service. Taxes take also a big bite of your revenue. In some countries, the VAT is 25%.
 
I am not sure if I am doing right atm, but it's just paste this code in the "add page" page?
Cause nothing happened for me when I tried to add this code, the site just turn white :/
 
Sorry for my double post
I solved it myself :p
@ (this only works if the file shop.php is in ur: www/system/pages/ )
Code:
require("config.php");
change to:
Code:
require("/../../config.php");
 
I did the same as xavizus did, But i got a error message:
Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\system\pages\donation.php on line 123

How do i solves this?
 
Back
Top