09-30-2011 06:59 AM
We had already implemented the Authorize.NET payment gateway in our site using AIM. Now I am trying to get implementing the Order Refund using the “CREDIT”. Please look into the below code snippet.
But I am getting the below error message. Let me know if anything wrong in my code
Error message: (92) The gateway no longer supports the requested method of integration. Authorize.Net
string post_string = string.Empty;
Hashtable post_values = new Hashtable();
//the API Login ID and Transaction Key must be replaced with valid values
#region General configuration
post_values.Add("x_trans_id", response1.TransactionID); // Valid Transaction ID return by Authorize.net after placing an order.
post_values.Add("x_card_num", cardNumber); // full credit card number
foreach (DictionaryEntry field in post_values)
post_string += field.Key + "=" + field.Value + "&";
post_string = post_string.TrimEnd('&');
// create an HttpWebRequest object to communicate with Authorize.net
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(m_PostURL);
objRequest.Method = "POST";
objRequest.ContentLength = post_string.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";
// post data is sent as a stream
StreamWriter myWriter = null;
myWriter = new StreamWriter(objRequest.GetRequestStream());
// Returned values are returned as a stream, then read into a string
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader responseStream = new StreamReader(objResponse.GetResponseStream()))
postResponse = responseStream.ReadToEnd();
Array responseArray = postResponse.Split('|');
09-30-2011 08:04 AM
Now i am getting the error like below. I using the sandbox environment.
A valid amount is required.,,P,0,,,0.00,CC,credit,,,,,,,,,,,,,,,,,,,,,,,,,,5EAA9954CAAC35BE636F5CADFA9C7BF7,,,,,,,,,,,,,XXXX4444,MasterCard,,,,,,,,,,,,,,,,
09-30-2011 08:29 AM
Thanks for the update. I have added the amount. But now its shows different error
"The referenced transaction does not meet the criteria for issuing a credit".
What i was doing here.
1. Place an order and checked order has approved.
2. Immediately i am trying to refund the order for that transatcion with Transaction ID.
09-30-2011 08:38 AM
A transaction have to be settled first before you can issue a CREDIT.
If it is unsettled you can use a VOID transaction. For VOID transaction, you do not need the x_amount and x_card_num.