Hello, I just got approved by zaypay and I'm doing some testing..
It seems that the users that pays doesn't get the points automatically, I get a log file with their account id and how much they paid so the script semi-works but the points doesn't get added, I have to do it manually.
Here is the zaypay script:
Help is appreciated!
- - - Updated - - -
Bump
It seems that the users that pays doesn't get the points automatically, I get a log file with their account id and how much they paid so the script semi-works but the points doesn't get added, I have to do it manually.
Here is the zaypay script:
PHP:
<?php
if(!defined('INITIALIZED'))
exit;
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')+$number_of_points));
$account->save();
}
echo '*ok*';
exit;
}
else
{
echo '*cannot save code to folder used_codes*';
exit;
}
}
else
{
echo '*code already used*';
exit;
}
}
echo '*bugged config*';
exit;
Help is appreciated!
- - - Updated - - -
Bump