cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify Transaction Post Location?

ASP.NET C# VS 2010 (using AuthorizeNet dll)

 

https://secure.authorize.net/gateway/transact.dll

 

I want to use above.

 

        IGateway OpenGateway() {
            //we used the form builder so we can now just load it up
            //using the form reader
            var login = ConfigurationManager.AppSettings["ApiLogin"];
            var transactionKey = ConfigurationManager.AppSettings["TransactionKey"];

            //this is set to test mode - change as needed.
            var gate = new Gateway(login, transactionKey, false);
            return gate;
        }

 

    protected void Button1_Click(object sender, EventArgs e) {
      var gate = OpenGateway();
      var sCCNum = txtCCNum.Text.Trim();
      var sMMYY = txtExp.Text.Trim();
      var dAmount = Convert.ToDecimal(txtAmount.Text.Trim());
      var sSecCode = txtSecCode.Text.Trim();

 

      var request = new AuthorizationRequest(sCCNum, sMMYY, dAmount, "Limo Service Order");

      //These are optional calls to the API
      request.AddCardCode(sSecCode);

      var sCCFirst = txtCCHolderNameF.Text.Trim();
      var sCCLast = txtCCHolderNameL.Text.Trim();
      var sAddrLine1 = txtAddrLine1.Text.Trim();
      var sAddrState = txtAddrState.Text.Trim();
      var sAddrZip = txtAddrZip.Text.Trim();
      request.AddCustomer("", sCCFirst, sCCLast, sAddrLine1, sAddrState, sAddrZip);

      //send to Auth.NET
      var response = gate.Send(request);

 

On Submit button, do I use PostBackUrl?

Is there anything else I am missing above?

 

Thanks,

Ashok

 

 

ashok122
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Transaction Key was inactive.

 

Created new Transaction Key and it's working now.

 

Thanks,

Ashok

View solution in original post

6 REPLIES 6

Look like you are using AIM. You already sending it to the live site with testmode set to false on

var gate = new Gateway(login, transactionKey, false);

 

Should be getting a response in

var response = gate.Send(request);

 

is it erroring?

 

RaynorC1emen7
Expert

Yes,

 

Error # 13

 

The merchant Login ID is invalid or the account is inactive.

 

I called customer support, but they said my account is active.

I could not get any other help.

 

They said make sure I am using

https://secure.authorize.net/gateway/transact.dll

 

Thanks

Ashok

double check the loginID and transactionKey in web.config . And make sure appSettings key spell the same.

It is 100% the same.

 

    <appSettings>
      <add key="ApiLogin" value="this is 100% correct"/>
      <add key="TransactionKey" value="this is 100% correc"/>
      <add key="MerchantHash" value="MERCHANT_HASH"/>
    </appSettings>

 

What is MerchantHash?  What should be the value?  And do I need to use it?

 

Thanks,

Ashok

 

If everything look correct, run it in debug.

Transaction Key was inactive.

 

Created new Transaction Key and it's working now.

 

Thanks,

Ashok