I’m trying to implement a code to refund transaction credit card with AIM. These are the fields that I am sending to the Authorize.net server for the refund:
x_version = "3.1"
x_login = loginID.ToString
x_amount = TransactionTotal.ToString
x_type = "credit"
x_trans_id = TransactionIDToCredit
x_card_num = CreditCardFourDigits.ToString
x_relay_response = True
x_description" = Description
After I get the values for each one of these variables, I send them in an HTML form to the Authorize.net server and hopefully expect a response from them. But there are some problems with my code or this way to get refunds is not available any more. This is the message that I’m receiving from server:
x_response_code: 3
x_response_reason_code: 92
x_response_reason_text: The gateway no longer supports the requested method of integration.
And this is part of my coding on the page:
'Here we create a HTML form in the code behind to POST the information to the credit card gateway Dim collections As New NameValueCollection() collections.Add("x_version", "3.1") collections.Add("x_login", loginID.ToString) collections.Add("x_amount", TransactionTotal.ToString) collections.Add("x_type", "credit") collections.Add("x_trans_id", TransactionIDToCredit.ToString) collections.Add("x_card_num", CreditCardFourDigits.ToString) collections.Add("x_relay_response", "True") collections.Add("x_description", Description.ToString) collections.Add("x_relay_url", "http://bglocal.com/RelayPage.aspx") 'This is the URL for the page on my site that receive the relay massage from the credit card gateway Dim remoteUrl As String = "https://test.authorize.net/gateway/transact.dll" 'This URL is only for testing purposes / sandbox account Dim html As String = "<html><head>" html += "</head><body onload='document.forms[0].submit()'>" html += String.Format("<form name='AimForm' method='POST' action='{0}'>", remoteUrl) For Each key As String In collections.Keys html += String.Format("<input name='{0}' type='Hidden' value='{1}'>", key, collections(key)) Next html += "</form></body></html>" Response.Clear() Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1") Response.HeaderEncoding = Encoding.GetEncoding("ISO-8859-1") Response.Charset = "ISO-8859-1" Response.Write(html) Response.End()
Thanks
Solved! Go to Solution.
05-18-2015 09:51 AM
But it is there:
post_values.Add("x_tran_key", transactionKey.ToString)
the fifth one. Can you see it ? Thanks for your help.
05-25-2015 07:03 PM - edited 05-25-2015 07:08 PM
It the other Best Practice Fields
x_delim_data = TRUE
x_relay_response = FALSE
05-26-2015 05:10 AM
I saw these 'Best Practice Fields' before and according to the manual they are optional. However, it is weird that without them the test was giving me errors. I do not understand. Anyway, everything is working fine now after I included them.
Thanks very much for your help.
05-28-2015 07:13 AM