<?php
$payalogue_id="115024";
?>
<center><h1>Donate via Zaypay</h1><center>
<b>1. Accept the terms and agreements.<b><br></br></b>
<b>2. Make sure you are logged in with the correct account.<b><br></br></b>
<b>3. Chose how much you would like to donate by clicking one of buttons below.<b><br></br></b>
<b>4. Follow the instructions at zaypay.<b><br></br></b>
<b>5. You will get your premium points automatically after payment.<b><br></br></b>
<b>6. Go to "Choose gifts" to pick your gifts.<b><br></br></b>
<b>Note that some extra service charges can be included in your price depending on country and currency. The prices below are average prices and the exact price will be shown at checkout after clicking one of the buttons below.<b><br></br></b>
<b>Get 1000 points with 5 Euros<br></br></b>
<script src="http://www.zaypay.com/pay/<?php echo $payalogue_id; ?>.js" type="text/javascript"></script>
<a href="http://www.zaypay.com/pay/<?php echo $payalogue_id; ?>" onclick="ZPayment(this); return false"></a>
<?php
require_once('includes/config.php');
require_once('includes/Zaypay.class.php');
require_once('includes/database.php');
// Start session engine
session_start();
// Makesure this is not a guest
if(!isset($_SESSION['account'])) {
die($message_to_guests);
}
$Zaypay = New Zaypay($price_setting_id, $price_setting_key);
// Fourth step: check payment
if (isset($_POST['action']) && $_POST['action'] == 'paid' && isset($_POST['paymentid'])) {
$zaypay_info = $Zaypay->show_payment($_POST['paymentid']);
$status = $zaypay_info['payment']['status'];
if (isset($zaypay_info['payment']['verification-needed']) and $zaypay_info['payment']['verification-needed'] == 'true' and isset($_POST['verification_code'])) {
if ($zaypay_info = $Zaypay->verification_code($_POST['paymentid'], $_POST['verification_code'])) {
$status = $zaypay_info['payment']['status'];
}
}
if ($status == 'paid') {
include ('./pages/3-paid.php');
$Zaypay->mark_payload_provided($_POST['paymentid']);
}
elseif ($status == 'prepared' or $status == 'in_progress' or $status == 'paused') {
include ('./pages/2-pay.php');
}
else {
echo "An error has occured [{$status}]";
}
}
// Third step: Let consumer pay
elseif (isset($_POST['action']) && $_POST['action'] == 'pay' && isset($_POST['locale']) && isset($_POST['paymentmethod'])) {
if(!($zaypay_info = $Zaypay->create_payment($_POST['locale'], $_POST['paymentmethod']))){
die ($Zaypay->getError());
}
// Here you could insert the payment information into your database. For Example:
mysql_query("INSERT INTO vapus_payment (payID, account_id, status) VALUES ('{$Zaypay->getPaymentId()}', '{$_SESSION['account']}', 'prepared')");
include ('./pages/2-pay.php');
}
// First step: Let consumer choose country and language
else {
if(!($locales = $Zaypay->list_locales())) {
die($Zaypay->getError());
}
if (isset($_POST['locale_country']) and isset($_POST['locale_language'])) {
$Zaypay->setLocale($_POST['locale_language'] . '-' . $_POST['locale_country']);
}
else {
if($noIPCheck || !$Zaypay->locale_for_ip($_SERVER['REMOTE_ADDR'])) {
$Zaypay->setLocale($defaultCountry);
}
}
if(!($payment_methods = $Zaypay->list_payment_methods($Zaypay->getLocale()))){
die($Zaypay->getError());
}
include('./pages/1-choosemethod.php');
}
?>
<?php
$price_setting_id = 122144; // Id
$price_setting_key = 'bbd4bddca3718d4666639ce3101018d7'; // Hash
$points_to_give = 1000; // Points to give after to have paid
$message_to_guests = "You MUST be logged in!";
$message_on_paid = "You have paid!";
$show_native = 0; // Longer language name, but easier for people without English knowledge
$noIPCheck = 0; // If true, then the default settings will be used instead of IP check
$defaultCountry = 'en-SE'; // format is languageCode-countryCode
?>
<?php
$mysqlConn = $db = mysql_connect("localhost", "root", "xxxxxxx");
mysql_select_db("spophi", $mysqlConn);
?>
<?php
/*-----------------------------------------------------------------------
Name : report.php
Version : 1.2-PHP5
Description : Retrieve payment information, when triggerd by Zaypay
Date : June 2009, Amsterdam, The Netherlands
By : Zaypay International B.V. 2008 - 2009 (RDF)
Last changes : Made class easier to use and understand
-----------------------------------------------------------------------*/
require_once('includes/config.php');
require_once('includes/Zaypay.class.php');
require_once('includes/database.php');
$Zaypay = New Zaypay($price_setting_id, $price_setting_key);
if (isset($_GET['payment_id'])) {
$zaypay_info = $Zaypay->show_payment($_GET['payment_id']);
$payment_id = $zaypay_info['payment']['id'];
$payment_status = $zaypay_info['payment']['status'];
// Get the ID
$result = mysql_query("SELECT * FROM zaypay_payment WHERE payID='{$payment_id}' LIMIT 1");
$array = mysql_fetch_assoc($result);
// Get current amount of points
$pp = mysql_query("SELECT premium_points FROM accounts WHERE accounts.id = '{$array['account_id']}'");
$points = mysql_fetch_assoc($pp);
$point = $points["premium_points"] + $points_to_give;
// Update to new status in database
mysql_query("UPDATE zaypay_payment SET status = '{$payment_status}' WHERE payID = '{$payment_id}'");
// Only give points if the status is "paid"
if ($payment_status == "paid" && $array["status"] != "paid") {
// Update points in account table
mysql_query("UPDATE accounts SET premium_points = '$point' WHERE accounts.id = '{$array['account_id']}'");
mysql_query("INSERT INTO `z_shop_points_bought` (`id`, `amount`, `type`, `accountid`, `code`, `paypalmail`, `date`) VALUES (NULL , '".$points_to_give."', 'Zaypay', '".$array['account_id']."', '".$payment_id."', 'N/A',CURRENT_TIMESTAMP);");
}
}
die ('*ok*');
?>
http://xxxxxxxx/zaypay/report.php
¨DROP TABLE IF EXISTS `vapus_payment`;
CREATE TABLE `vapus_payment` (
`payID` bigint(30) NOT NULL,
`account_id` int(20) NOT NULL,
`status` varchar(255) NOT NULL,
PRIMARY KEY (`payID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
about the sql i was havent it, just created it so i hope it works
Price Settings -> Edit -> Report URLDo you have this at your payment settings on the Zaypay account?
Code:http://xxxxxxxx/zaypay/report.php