· 6 years ago · Feb 19, 2019, 12:44 PM
1<?php
2/*
3English:
4This script will help you to integrate PayGol as your sms payment gateway in your Tibia, users can donate and they can have their points in-game, this mean they don't have to wait hours or even days to get their points.
5Please read this link http://www.slideshare.net/paygol/paygol-automatic-sms-payments-in-tibia which will guide you step by step.
6
7Note:Before starting you have to create an account at http://www.paygol.com/register
8
9Espanol:
10Este codigo te ayudara a integrar PayGol como tu plataforma de pagos por sms en tu Tibia, tus usuarios podran donar y podran obtener sus puntos de inmediato, no tendran que esperar horas o hasta dias para obtener sus puntos.
11Por favor, lee esta guia http://www.slideshare.net/paygol/paygol-automatic-smspaymentsintibiaes que te ayudara paso a paso..
12
13Nota:Antes de comenzar, debes crear una cuenta en http://www.paygol.com/register
14*/
15
16
17$secret_key = "5ffff680-7703-11e7-91b6-128b57940774"; // Enter secret key for your service.
18// Secret key validation
19if ($secret_key != $_GET['key']) {
20 echo "Validation error";
21 exit;
22}
23//Get all parameters from PayGol
24$message_id = $_GET[message_id];
25$shortcode = $_GET[shortcode];
26$keyword = $_GET[keyword];
27$message = $_GET[message];
28$sender = $_GET[sender];
29$operator = $_GET[operator];
30$country = $_GET[country];
31$custom = $_GET[custom];//
32$price = $_GET[price];
33$currency = $_GET[currency];
34$points = $_GET[points];
35
36//Replace these parameters by your database details
37$dbhost = "localhost"; //Your database domain
38$dbuser = "<databaseuser>"; //Database username
39$dbpassword = "<databasepass>"; //Database password
40$db = "<databasename>"; //Database name
41
42
43//Connect to Database
44$conn = mysql_connect($dbhost, $dbuser, $dbpassword);
45mysql_select_db($db);
46
47$sql = "UPDATE accounts SET premium_points = premium_points+$points WHERE name = '$custom'";
48mysql_query($sql);
49
50mysql_close($conn);
51
52?>