Ejemplo n.º 1
0
define('SECURITY', 'RV82RVHO5T0O5CZUUTX2FLHU');
if ($_POST) {
    $db = new FlatDb();
    $db->openTable('ordenes');
    $orden = $db->getRecords(array("id", "status", "data", "mediodepago", "sar", "form", "gaa", "requestkey", "answerkey"), array("id" => $operationid));
    $tipo = $_POST['tipo'];
    $monto = $_POST['monto'];
    if ($tipo == "total") {
        $anul = new \Decidir\Authorize\Execute\Devolucion\Total(array("security" => SECURITY, "merchant" => MERCHANT, "nro_operacion" => $operationid));
    } else {
        $anul = new \Decidir\Authorize\Execute\Devolucion\Parcial(array("security" => SECURITY, "merchant" => MERCHANT, "nro_operacion" => $operationid, "monto" => $monto));
    }
    $http_header = array('Authorization' => 'PRISMA RV82RVHO5T0O5CZUUTX2FLHU', 'user_agent' => 'PHPSoapClient');
    $connector = new Decidir\Connector($http_header, Decidir\Connector::DECIDIR_ENDPOINT_TEST);
    try {
        $rta = $connector->Authorize()->execute($anul);
    } catch (Exception $e) {
        var_dump($e);
        die;
    }
    $db->updateRecords(array("status" => "DEVUELTA"), array("id" => $operationid));
    header("Location: index.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>Administrador</title>
	<meta name="description" content="kleith web site" />
	<meta name="keywords" content="html, css, js, php" />
Ejemplo n.º 2
0
$data['mediopago']['medio_pago'] = $medio;
unset($data['mediopago']['tipo']);
if ($medio == 26) {
    $medio_pago = new Decidir\Data\Mediopago\Rapipago($data['mediopago']);
} else {
    if ($medio == 25) {
        $medio_pago = new Decidir\Data\Mediopago\PagoFacil($data['mediopago']);
    } else {
        if ($medio == 41) {
            $medio_pago = new Decidir\Data\Mediopago\PagoMisCuentas($data['mediopago']);
        } else {
            $medio_pago = new Decidir\Data\Mediopago\TarjetaCredito($data['mediopago']);
        }
    }
}
$cybersource = new Decidir\Data\Cybersource\Retail($data['cs_data'], $data['cs_product']);
$sar_data = new Decidir\Authorize\SendAuthorizeRequest\Data(array("security" => SECURITY, "encoding_method" => ENCODINGMETHOD, "merchant" => MERCHANT, "nro_operacion" => $operationid, "monto" => $data['monto'], "email_cliente" => $data["email_cliente"]));
$sar_data->setMedioPago($medio_pago);
//$sar_data->setCybersourceData($cybersource);
//creo instancia de la SDK
$connector = new Decidir\Connector($http_header, Decidir\Connector::DECIDIR_ENDPOINT_TEST);
try {
    $rta = $connector->Authorize()->sendAuthorizeRequest($sar_data);
} catch (Exception $e) {
    var_dump($e);
    die;
    $db->updateRecords(array("status" => "ERROR SAR"), array("id" => $operationid));
    header("Location: index.php");
}
$db->updateRecords(array("sar" => 1, "status" => "AUTORIZACION ENVIADA", "requestkey" => $rta->getRequestKey(), "publicrequestkey" => $rta->getPublicRequestKey()), array("id" => $operationid));
header("Location: index.php");