Beispiel #1
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stdf.php';
if (is_release()) {
    exit;
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/osmppay.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/billing.php';
if (isset($_POST['cancel'])) {
    $back_url = $_SESSION['referer'];
    unset($_SESSION['referer']);
    header("Location: {$back_url}");
    exit;
} elseif (isset($_POST['success'])) {
    $sum = $_SESSION['post_payment']['sum'];
    $bill = new billing(get_uid(false));
    $account = new osmppay();
    $error = $account->checkdeposit($op_id, $result, $sum, $bill->user['login'], rand(1, 999999999), date('YmdHis'));
    header('Location: /bill/');
    exit;
}
$bill = new billing(get_uid(false));
$bill->test = true;
$bill->setPaymentMethod('qiwi');
$created = $bill->error;
$_SESSION['post_payment'] = $_POST;
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
?>

<h2>Тестовая оплата Терминалы OSMP</h2>
<p>
Оплата услуг аккаунт #<?php 
echo get_uid(false);
Beispiel #2
0
}
$account = new osmppay();
$op_id = 0;
$result = 0;
if ($_GET['command'] === "check") {
    if ($_GET['account'] && $_GET['txn_id'] && $_GET['sum']) {
        $error = $account->prepare($result, $_GET['account'], $_GET['txn_id'], $_GET['sum']);
    } else {
        $result = 300;
        $error = "Неполный запрос";
    }
    $comment = $error ? $error : "Аккаунт найден";
} elseif ($_GET['command'] === "pay") {
    $sum = $_GET['sum'];
    if ($sum && $_GET['account'] && $_GET['txn_id'] && $_GET['txn_date']) {
        $error = $account->checkdeposit($op_id, $result, $sum, $_GET['account'], $_GET['txn_id'], $_GET['txn_date']);
        if ($error) {
            $result = 300;
            $error = "Неполный запрос";
        }
    } else {
        $result = 300;
        $error = "Неполный запрос";
    }
    $comment = $error ? $error : "Пополнение счета успешно завершено";
} else {
    $result = 300;
    $comment = "Введите запрос";
}
$log = new log('osmp/%d%m%Y.log');
$log->writeln('----- ' . date('d.m.Y H:i:s'));