forked from verdnatura/hedera-web
39 lines
711 B
PHP
39 lines
711 B
PHP
|
<?php
|
||
|
|
||
|
namespace Vn\Tpv;
|
||
|
|
||
|
static class Tpv
|
||
|
{
|
||
|
/**
|
||
|
* Tryes to confirm a transaction with the given params.
|
||
|
**/
|
||
|
static function confirm ($db, $params)
|
||
|
{
|
||
|
if (!(isset ($params['Ds_Amount'])
|
||
|
&& isset ($params['Ds_Order'])
|
||
|
&& isset ($params['Ds_MerchantCode'])
|
||
|
&& isset ($params['Ds_Currency'])
|
||
|
&& isset ($params['Ds_Response'])))
|
||
|
return FALSE;
|
||
|
|
||
|
if (isset ($params['Ds_ErrorCode']))
|
||
|
$error = $params['Ds_ErrorCode'];
|
||
|
else
|
||
|
$error = NULL;
|
||
|
|
||
|
return $db->query (
|
||
|
'CALL transaction_confirm (#, #, #, #, #, #)',
|
||
|
[
|
||
|
$params['Ds_Amount']
|
||
|
,$params['Ds_Order']
|
||
|
,$params['Ds_MerchantCode']
|
||
|
,$params['Ds_Currency']
|
||
|
,$params['Ds_Response']
|
||
|
,$error
|
||
|
]
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|