错误网关响应

时间:2016-03-16 13:53:58

标签: javascript gateway

我对使用网关emercnt的付款流程有疑问。我必须向网关提供所有变量,并在收费时得到答案。如果所有数据都正确,我可以收取费用,但我不知道如何从网关接收答案,手册给我一个线索,答案将提供变量" urlBack&#34 ;。你知道如何从这个网关获取数据吗?

首先我在javascript中处理所有日期然后我使用以下代码发送信息,但我将在另一页(https://acmax.mx/popup_2)中收到答案。一切都很好,但我的网关答案有问题。

非常感谢

    <form name="myPayTC" id="myPayTC" method="post" action="https://www.procom.prosa.com.mx/eMerchant/7727222_acmaxdemexico.jsp" onload='javascript:MyFrmOnLoad();'>

    <input type="hidden" id="total" name="total" value='total'>
    <input type="hidden" id="currency" name="currency" value="484">
    <input type="hidden" id="address" name="address" value="ACMAX">
    <input type="hidden" id="order_id" name="order_id" value='order_id'>
    <input type="hidden" id="merchant" name="merchant" value="7727222">
    <input type="hidden" id="store" name="store" value="1234">
    <input type="hidden" id="term" name="term" value="001">
    <input type="hidden" id="digest" name="digest" value='valDigest'>
    <input type="hidden" id="return_target" name="return_target" value="N/A">
    <!--<input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/index.php?controller=ComercioResp">-->
    <!--<input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/es/checkout/confirm">-->
    <input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/popup_2">
    <!--<input type="hidden" id="urlBack" name="urlBack" value="http://acmax.mx/es/checkout/paymentmethod">-->

    <p><img src="https://acmax.mx/themes/theme674/img//bankwire.jpg" alt="Pago por tarjeta de cr&eacute;dito/d&eacute;bito" width="86" height="54" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="pButton" value="Pago con Tarjeta de Cr&eacute;dito/D&eacute;bito" class="exclusive" style="font-size:14px; height:28px;"></p>

    </form>

具有服务器的代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML version="-//W3C//DTD HTML 4.01 Transitional//EN">
    <HEAD>
    <TITLE>Verificacion de Compra</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    </HEAD>
    <BODY>
    <form id="formars" name="formars" action="https://acmax.mx/popup_2" method="post">
    <input type="Hidden" name="EM_Response" value="denied">
    <input type="Hidden" name="EM_Total" value="102">
    <input type="Hidden" name="EM_OrderID" value="625">
    <input type="Hidden" name="EM_Merchant" value="7727222">
    <input type="Hidden" name="EM_Store" value="1234">
    <input type="Hidden" name="EM_Term" value="001">
    <input type="Hidden" name="EM_RefNum" value="initialrefnum">
    <input type="Hidden" name="EM_Auth" value="000000">
    <input type="Hidden" name="EM_Digest" value="initialdigest">

    <input type="Hidden" name="cc_number" value="0565">
    <input type="Hidden" name="total" value="102">
    <input type="Hidden" name="order_id" value="625">
    <input type="Hidden" name="merchant" value="7727222">
    <input type="Hidden" name="tx_id" value="322307f91ef2b5318e5d720f49fb30dace2ca474">


            <input name="pButton" value="Pago con Tarjeta de Crédito/Débito" type="Hidden" />

            <input name="address" value="ACMAX" type="Hidden" />

    </form>
    <script type="text/javascript">
    var formars = document.getElementById('formars');
    formars.submit();

    </script>
    </BODY>

    </HTML>

我无法更改此代码,因此我需要从表单中获取数据&#34; formars&#34;

1 个答案:

答案 0 :(得分:0)

嗯,例如,如果您已将urlBack参数设置为某个php页面,那么我们称之为returnCall.php

现在,如果支付网关正在发回以下“发布”数据:

name1=cat&name2=dog&name3=echidna

然后在您的php页面中,您可以按如下方式读取该数据:

<?php
   $value1 = $_POST["name1"];
   $value2 = $_POST["name2"];
   $value3 = $_POST["name3"];
?>

<p>
    <ul>
        <li>Value1 = <?=$value1?></li>
        <li>Value2 = <?=$value2?></li>
        <li>Value3 = <?=$value3?></li>
    </ul>
</p>

然后页面上的输出将转换为:

<p>
    <ul>
        <li>Value1 = cat</li>
        <li>Value2 = dog</li>
        <li>Value3 = echidna</li>
    </ul>
</p>

你可以类似地拥有一个可以做同样事情的aspx页面。

string Value1;
string Value2;
string Value3;

protected void Page_Load(object sender, EventArgs e)
{
    Value1 = Request.Form["name1"];
    Value2 = Request.Form["name2"];
    Value3 = Request.Form["name3"];
}