Using this scripts, but for somehow all works beside its adding the points you've chosen to your account..
Also Iv tried with their "Test", when you trying to buy the point wont be added. But Iv used all this before and worked great. But Now Im working with a 0.3.6 site and the script is from a 0.4 site.
Here is my script:
Also Iv tried with their "Test", when you trying to buy the point wont be added. But Iv used all this before and worked great. But Now Im working with a 0.3.6 site and the script is from a 0.4 site.
Here is my script:
Code:
<?php
require_once('./custom_scripts/zaypay/config.php');
if(isset($_GET['payment_id']) && isset($_GET["price_setting_id"]) && isset($options[$_GET["price_setting_id"]]))
{
$option = $options[$_GET["price_setting_id"]];
$zaypay = new Zaypay($option['price_id'], $option['price_key']);
$zaypay_info = $zaypay->show_payment($_GET['payment_id']);
if($zaypay_info["payment"]["status"] == 'paid' && !file_exists('./custom_scripts/zaypay/used_codes/zay_id_' . $zaypay_info["payment"]["id"]. '.txt'))
{
$_acc = explode('=', $zaypay_info["payment"]["your-variables"]);
$acc = $_acc[1];
if(file_put_contents('./custom_scripts/zaypay/used_codes/zay_id_' . $zaypay_info["payment"]["id"]. '.txt' , 'account:' . $acc . ',amount-euro:' . $zaypay_info["payment"]["amount-euro"] . ',points:' . $option['points']) !== false)
{
$account = new Account($acc);
if($account->isLoaded())
{
$account->set('premium_points', ($account->getCustomField('premium_points')+$option['points']));
$account->save();
}
echo '*ok*';
exit;
}
else
{
echo '*cannot save code to folder used_codes*';
exit;
}
}
else
{
echo '*code already used*';
exit;
}
}
echo '*ok*';
exit;
?>