Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 4
Registered: ‎04-08-2013
Accepted Solution

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

 

 


Accepted Solutions
Highlighted
Solution
Accepted by topic author ashok122
‎08-21-2015 01:58 AM
Member
Posts: 4
Registered: ‎04-08-2013

Re: How to specify Transaction Post Location?

[ Edited ]

Transaction Key was inactive.

 

Created new Transaction Key and it's working now.

 

Thanks,

Ashok

View solution in original post


All Replies
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: How to specify Transaction Post Location?

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?

 

Member
Posts: 4
Registered: ‎04-08-2013

Re: How to specify Transaction Post Location?

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

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: How to specify Transaction Post Location?

[ Edited ]

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

Member
Posts: 4
Registered: ‎04-08-2013

Re: How to specify Transaction Post Location?

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

 

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: How to specify Transaction Post Location?

[ Edited ]

If everything look correct, run it in debug.

Highlighted
Solution
Accepted by topic author ashok122
‎08-21-2015 01:58 AM
Member
Posts: 4
Registered: ‎04-08-2013

Re: How to specify Transaction Post Location?

[ Edited ]

Transaction Key was inactive.

 

Created new Transaction Key and it's working now.

 

Thanks,

Ashok