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
Solved! Go to Solution.
04-08-2013 05:46 PM
Transaction Key was inactive.
Created new Transaction Key and it's working now.
Thanks,
Ashok
04-10-2013 05:23 PM - edited 04-10-2013 05:24 PM
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?
04-08-2013 06:07 PM
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
04-08-2013 06:14 PM
double check the loginID and transactionKey in web.config . And make sure appSettings key spell the same.
04-08-2013 06:21 PM - edited 04-08-2013 06:24 PM
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
04-08-2013 06:34 PM
If everything look correct, run it in debug.
04-09-2013 04:27 AM - edited 04-09-2013 04:27 AM
Transaction Key was inactive.
Created new Transaction Key and it's working now.
Thanks,
Ashok
04-10-2013 05:23 PM - edited 04-10-2013 05:24 PM