0
1
Fork 0
hedera-web-mindshore/web/rest/tpv.php

38 lines
706 B
PHP
Executable File

<?php
require_once ('vn/tpv/tpv.php');
use Vn\Rest;
use Vn\Tpv;
class RestMod extends Rest\Module
{
function run ()
{
if (empty ($_REQUEST['amount']))
throw new Rest\Exception ('Tpv', 'badRequest', s('Bad request'));
$params = Tpv::transactionStart (
$this->conn
,(int) $_REQUEST['amount']
,empty ($_REQUEST['urlOk']) ? NULL : $_REQUEST['urlOk']
,empty ($_REQUEST['urlKo']) ? NULL : $_REQUEST['urlKo']
,empty ($_REQUEST['company']) ? NULL : $_REQUEST['company']
,$url
,$signature
);
$result = [
'url' => $url
,'params' => $params
,'signature' => $signature
];
trigger_error (print_r ($result, TRUE));
return $result;
}
}
?>