Posted in

Pasarela Sermepa/Redsys Devolución de pagos

La pasarela permite realizar la devolución de cobros realizados desde la misma pasarela. Para ello es necesario guardar a la hora de realizar el cobro el id del cobro.

$name = 'XX XXXX';
o$code = 'XXXXXX'; //codi comerç
o$terminal = '1';
o$currency = '978';
o$MerchantData = "1";
o$urlMerchant = 'http://www.ultracavallsdelvent.com/public/scripts/pasos-inscripciones/individual/tpv-resposta.php';
o
o$urlOK = 'http://www.ultracavallsdelvent.com/inscripcion-ok.php';
o$urlKO = 'http://www.ultracavallsdelvent.com/in
<?
orequire("ucvconfig/config.pasarela.php");
o$order = $_REQUEST['order_id'];

o$transactionType = '3';
o$urlMerchant = 'http://www.ultracavallsdelvent.com/privat/scripts/retorns-cobraments/retorns.php?taula=cvvinsc_resultats_baixes';

o$urlOK = 'http://www.ultracavallsdelvent.com/public/scripts/sorteo/ok.html';
o$urlKO = 'http://www.ultracavallsdelvent.com/public/scripts/sorteo/ko.html';

o$titular = '';
o$producto = 'Retorn Pagament UCV2013';
o
o//Dades necessàries per al retorn
o$amount = intval($preu) * 100;//Preu de la preinscripcio
o//$sumTotal = 9000; //Preu de la preinscripcio + inscripcio
o$freqRecursiva = 1;
o$firma = $amount . $order . $code . $currency . $transactionType . $urlMerchant . $clave;
o$signature = strtoupper(sha1($firma));
o//echo $amount . " - " . $order . " - " . $code . " - " . $currency . " - " . $transactionType . " - " . $urlMerchant . " - " . $clave; 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Devolució unica</title>
    <script src="../public/jq-plugins/jquery-1.7.1.min.js"></script>
    <script>
o$(document).ready(function(){
o$('#returnForm').submit();
o});
o</script>
</head>

<body>
o<form id="returnForm" action="<?php echo $url_tpvv;?>" method="post">
        <table>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_Amount" value="<?php echo $amount;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_Currency" value="<?php echo $currency;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_Order" id="orderNum" value="<?=$order?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_ProductDescription" value="<?php echo $producto;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_Titular" value="<?php echo $titular;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_MerchantCode" value="<?php echo $code;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_MerchantURL" value="<?php echo $urlMerchant;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_UrlOK" value="<?php echo $urlOK;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_UrlKO" value="<?php echo $urlKO;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_MerchantSignature" id="signatura" value="<?=$signature?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_TransactionType" value="<?php echo $transactionType;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_MerchantData" value="<?php echo $MerchantData;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_DateFrecuency" value="<?php echo $freqRecursiva;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_ChargeExpiryDate" value="<?php echo $dataMaxima;?>">
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="Ds_Merchant_Terminal" value="<?php echo $terminal;?>">
                </td>
            </tr>            
        </table>
    </form>
</body>
</html>

Deixa un comentari

L'adreça electrònica no es publicarà. Els camps necessaris estan marcats amb *


The reCAPTCHA verification period has expired. Please reload the page.