简体   繁体   English

错误:(103)无法接受此交易-Authorize.Net

[英]Error: (103) This transaction cannot be accepted - Authorize.Net

I am new to Authorize.net, trying to integrate my demo website to Authorize.net. 我是Authorize.net的新手,试图将我的演示网站集成到Authorize.net。 When I click on pay button an error"(103) This transaction cannot be accepted" occurs every time. 当我单击付款按钮时,每次都会发生错误“(103)无法接受此交易”。 Searched all over web but couldn't resolved. 在整个网络上搜索,但无法解决。 Can anyone point out what I am missing in? 谁能指出我想念的东西? Here is the asp.net code I am using. 这是我正在使用的asp.net代码。

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
    <div>
        <div id="divCreditPay" runat="server" style="margin: 10px 30px 10px 10px; background-color: transparent !important; border: 1px solid #cccccc; padding: 15px;">
            <span id="spanCreditPay" style="padding: 1px 0 5px 5px;">


            <input type="hidden" name="x_fp_hash" value="'<%= AuthorizeNet_x_fp_hash %>'" />
            <input type="hidden" name="x_fp_sequence" value="'<%= AuthorizeNet_x_fp_sequence %>'" />
            <input type="hidden" name="x_invoice_num" value="'<%= PurchaseID %>'" />
            <input type="hidden" name="x_fp_timestamp" value="'<%= AuthorizeNet_x_fp_timestamp %>'" />
            <input type="hidden" name="x_login" value="6dubCXe76W" />
            <input type="hidden" name="x_relay_url" value="'<%= AuthorizeNet_x_relay_url %>'" />
            <%--<input type='hidden' name='x_relay_response' value="'<%= AuthorizeNet_x_relay_response %>'" />--%>
            <input type="hidden" name="x_relay_response" value="True" />

            <input type="hidden" name="x_receipt_link_url" value="'<%= AuthorizeNet_x_receipt_link_url %>'" />
            <input type="hidden" name="x_test_request" value="'<%= AuthorizeNet_x_test_request %>'" />
            <input type="hidden" name="x_method" value="CC" />
            <input type="hidden" name="x_type" value="AUTH_CAPTURE" />
            <input type="hidden" name="x_first_name" value="'<%= AuthorizeNet_x_first_name %>'" />
            <input type="hidden" name="x_last_name" value="'<%= AuthorizeNet_x_last_name %>'" />
            <input type="hidden" name="x_amount" value='<%=AuthorizeNet_x_amount%>' />
            <input type="hidden" name="x_address" value="'<%= AuthorizeNet_x_address %>'" />
            <input type="hidden" name="x_city" value="'<%= AuthorizeNet_x_city %>'" />
            <input type="hidden" name="x_state" value="'<%= AuthorizeNet_x_state %>'" />
            <input type="hidden" name="x_zip" value="'<%= AuthorizeNet_x_zip %>'" />

            <div id="divminiContainer" style="padding: 15px 0px 15px 25px;">
                <table id="tblCreditPay" style="width: 100%;">
                    <tr>
                        <td class="tdCreditPay" style="width: 25%;">Card number</td>
                        <td>
                            <asp:TextBox ID="txt_creditCard" runat="server" Width="253px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><span>mm</span><span style="padding-left: 45px">yy</span></td>
                    </tr>
                    <tr>
                        <td>Expiration date</td>
                        <td>
                            <asp:TextBox ID="txt_expDate" runat="server" Width="50px"></asp:TextBox>
                            / 
                    <asp:TextBox ID="txt_expYear" runat="server" Width="50px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>CSC (optional)</td>
                        <td>
                            <asp:TextBox ID="txt_csc" runat="server" Width="50px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr style="padding-top: 15px;">
                        <td></td>
                        <td>
                            <asp:Button runat="server" ID="btn_payNowCC" OnClick="btn_payNowCC_Click" Text="btn_payNowCC" />
                        </td>
                    </tr>
                </table>

                </div>
        </div>


    </div>
</form> </body> </html>

and Code Behind 和背后的代码

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btn_payNowCC.PostBackUrl = "https://test.authorize.net/gateway/transact.dll";
        //btn_payNowCC.PostBackUrl = "https://secure.authorize.net/gateway/transact.dll";  
    }
    protected void btn_payNowCC_Click(object sender, EventArgs e)
    {        
        string ccNumber = txt_creditCard.Text;
        string dt = txt_expDate.Text + txt_expYear.Text;

        strAuthorizeNet_x_amount = "12.34";
        strAuthorizeNet_x_login = ConfigurationManager.AppSettings["AUTHORIZE_NET_API_LOGIN"];
        strAuthorizeNet_x_first_name = "Hr";
        strAuthorizeNet_x_last_name = "Hnw";
        strAuthorizeNet_x_address = "123 main st.";
        strAuthorizeNet_x_city = "Indore";
        strAuthorizeNet_x_state = "MP";
        strAuthorizeNet_x_zip = "123456";

        strAuthorizeNet_x_fp_timestamp = AuthorizeNet.Crypto.GenerateTimestamp().ToString();
        strAuthorizeNet_x_fp_sequence = AuthorizeNet.Crypto.GenerateSequence();
        strAuthorizeNet_x_relay_response = "TRUE";
        strAuthorizeNet_x_test_request = "TRUE";
        strAuthorizeNet_x_fp_hash = AuthorizeNet.Crypto.GenerateFingerprint("88v7G7Emg965Nb9s", strAuthorizeNet_x_login, decimal.Parse(strAuthorizeNet_x_amount), strAuthorizeNet_x_fp_sequence, strAuthorizeNet_x_fp_timestamp);
        //strAuthorizeNet_x_fp_hash = AuthorizeNet.Crypto.GenerateFingerprint(ConfigurationManager.AppSettings["AUTHORIZE_NET_TRANSACTION_KEY"], strAuthorizeNet_x_login, decimal.Parse(strAuthorizeNet_x_amount), strAuthorizeNet_x_fp_sequence, strAuthorizeNet_x_fp_timestamp);

        strAuthorizeNet_x_relay_url = ConfigurationManager.AppSettings["MainWebURL"] + "SIM.aspx";

        strAuthorizeNet_x_receipt_link_url = ConfigurationManager.AppSettings["MainWebURL"] + "Thanks.aspx";      
    }

and here is web.config 这是web.config

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <appSettings>
    <add key="AUTHORIZE_NET_API_LOGIN" value="6dubCXe76W"/>
    <add key="AUTHORIZE_NET_TRANSACTION_KEY" value="88v7G7Emg965Nb9s"/>
    <add key="AUTHORIZE_NET_MD5_HASH" value="" />
    <add key="MainWebURL" value="https://test.authorize.net/gateway/transact.dll"/>
  </appSettings>

    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>

From Authorize.Net : Authorize.Net

Response Reason Code: 103 响应原因码:103

Response Reason Text: A valid fingerprint or Transaction Key is required for this transaction. 响应原因文本:此事务需要有效的指纹或事务密钥。

This error is generated when your Authorize.Net account is in Password-Required Mode and you are not sending a valid Transaction Key or hash fingerprint with your transaction request. 当您的Authorize.Net帐户处于要求密码的模式,并且您没有随交易请求发送有效的交易密钥或哈希指纹时,会生成此错误。 For security reasons we recommend always submitting a Transaction Key or hash fingerprint. 出于安全原因,我们建议您始终提交交易密钥或哈希指纹。 Additionally: 另外:

If you are using SIM, make sure you are using a valid Transaction Key to generate and send a fingerprint hash along with your transaction request. 如果使用的是SIM,请确保使用有效的交易密钥来生成和发送指纹哈希以及交易请求。 The fingerprint hash should be submitted using the field x_fp_hash. 指纹哈希应使用字段x_fp_hash提交。 If you are using SIM and submit a request for a Credit, Void, or Prior Authorization Capture (x_type = CREDIT, VOID or PRIOR_AUTH_CAPTURE) you may encounter this error. 如果您使用的是SIM卡并提交了信用,无效或预先授权捕获请求(x_type = CREDIT,VOID或PRIOR_AUTH_CAPTURE),则可能会遇到此错误。 For security reasons these transaction types must be processed by logging into the Merchant Interface directly, or by using a desktop application that uses AIM. 出于安全原因,必须通过直接登录到Merchant Interface或使用使用AIM的桌面应用程序来处理这些事务类型。

Basically your fingerprint or transaction key are wrong. 基本上,您的指纹或交易密钥是错误的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM