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

34 lines
674 B
PHP
Raw Normal View History

2016-07-22 20:00:27 +00:00
<?php
2018-05-23 10:14:20 +00:00
class Tpv {
2016-07-22 20:00:27 +00:00
/**
* Tryes to confirm a transaction with the given params.
2022-05-26 06:08:31 +00:00
*/
2018-05-23 10:14:20 +00:00
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'])))
2016-07-22 20:00:27 +00:00
return FALSE;
2018-05-23 10:14:20 +00:00
if (isset($params['Ds_ErrorCode']))
2016-07-22 20:00:27 +00:00
$error = $params['Ds_ErrorCode'];
else
$error = NULL;
2018-05-23 10:14:20 +00:00
return $db->query(
2019-05-21 14:16:27 +00:00
'CALL tpvTransaction_confirm(#, #, #, #, #, #)',
2016-07-22 20:00:27 +00:00
[
$params['Ds_Amount']
,$params['Ds_Order']
,$params['Ds_MerchantCode']
,$params['Ds_Currency']
,$params['Ds_Response']
,$error
]
);
}
}