$data = json_decode($orden[0]['data'], true); $medio = $_POST['tipo']; if ($medio == 26) { $data = array_merge($data, array("mediopago" => array("tipo" => $medio, "cantdiasfechavenc" => $_POST['rpcantdiasfechavenc'], "cantdiaspago" => $_POST['rpcantdiaspago'], "recargo" => $_POST['rprecargo'], "fechavto" => $_POST['rpfechavto'], "cliente" => $_POST['rpcliente']))); } else { if ($medio == 25) { $data = array_merge($data, array("mediopago" => array("tipo" => $medio, "recargo" => $_POST['pfrecargo'], "fechavto" => $_POST['pffechavto'], "fechavto2" => $_POST['pffechavto2']))); } else { if ($medio == 41) { $data = array_merge($data, array("mediopago" => array("tipo" => $medio, "fechavto" => $_POST['pmcfechavto']))); } else { $data = array_merge($data, array("mediopago" => array("tipo" => $medio, "cuotas" => $_POST['cuotas']))); } } } $db->updateRecords(array("data" => json_encode($data), "mediodepago" => 1), 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" /> <!-- Le styles --> <link href="css/css.css" media="screen" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/js.js"></script>
$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" /> <!-- Le styles --> <link href="css/css.css" media="screen" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/js.js"></script>
<?php include_once dirname(__FILE__) . "/FlatDb.php"; include_once dirname(__FILE__) . "/../../vendor/autoload.php"; $operationid = $_GET['ord']; $answer = $_GET['pa']; $db = new FlatDb(); $db->openTable('ordenes'); $db->updateRecords(array("form" => 1, "answerkey" => $answer), array("id" => $operationid)); header("Location: index.php");
<?php include_once dirname(__FILE__) . "/FlatDb.php"; include_once dirname(__FILE__) . "/../../vendor/autoload.php"; $operationid = $_GET['ord']; $db = new FlatDb(); $db->openTable('ordenes'); $http_header = array('Authorization' => 'PRISMA RV82RVHO5T0O5CZUUTX2FLHU', 'user_agent' => 'PHPSoapClient'); //datos constantes define('CURRENCYCODE', 032); define('MERCHANT', 22067736); define('ENCODINGMETHOD', 'XML'); define('SECURITY', 'RV82RVHO5T0O5CZUUTX2FLHU'); $connector = new Decidir\Connector($http_header, Decidir\Connector::DECIDIR_ENDPOINT_TEST); $anul = new \Decidir\Authorize\Execute\Anulacion(array("security" => SECURITY, "merchant" => MERCHANT, "nro_operacion" => $operationid)); try { $rta = $connector->Authorize()->execute($anul); } catch (Exception $e) { var_dump($e); die; } $db->updateRecords(array("status" => "ANULADA"), array("id" => $operationid)); header("Location: index.php");
$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");