I am using Alpha Five V9 and am trying to configure a button on a desktop application to run an Authorize.net transaction. There are a couple of variables that are created first when the button is pushed that stores the card #, name, expiration date, amount and email address. I get the Transaction was NOT processed every time I push the button. Any ideas would be greatly appreciated!
The xbasic code is as follows:
dim x as AuthorizeNet_transaction
x.login = "blahblahblah"
x.tran_key = "aBcDeFgHiJkLmN"
x.version = "3.1"
x.amount = Var->vAuthAmt
x.card_num = var->vAuthCardNum
x.exp_date = var->vAuthExp
x.type = "AUTH_CAPTURE"
x.last_name = var->vAuthCardName
x.invoice_num = var->vAuthAccount
x.email = vAuthEmail
x.process()
if x.process() then
'x.process() will return true if the transaction server accepted the request and attempted to process the transaction
dim y as p
dim result_msg as c
dim result_title as c = ""
y = x.result
result_msg = y.Response_Reason_Text
if (y.response_code = "1")
' Authorize.Net defines response code 1 as "Approved"
result_title = "Approved"
*concat(result_msg,crlf()+ "Approval Code: " + y.Approval_Code)
elseif (y.response_code = "2")
'Authorize.Net defines response code 2 as "Declined"
result_title = "declined"
elseif (y.response_code = "3")
'Authorize.Net defines response code 3 as "Error"
result_title = "error"
end if
*concat(result_title," " + "Transaction " + y.Transaction_ID)
ui_msg_box(result_title,result_msg)
else
'if x.process() is false, the transaction server could not be contacted or did not respond in a timely manner
ui_msg_box("", "Transaction NOT processed", UI_ATTENTION_SYMBOL)
end if
The xbasic code is as follows:
dim x as AuthorizeNet_transaction
x.login = "blahblahblah"
x.tran_key = "aBcDeFgHiJkLmN"
x.version = "3.1"
x.amount = Var->vAuthAmt
x.card_num = var->vAuthCardNum
x.exp_date = var->vAuthExp
x.type = "AUTH_CAPTURE"
x.last_name = var->vAuthCardName
x.invoice_num = var->vAuthAccount
x.email = vAuthEmail
x.process()
if x.process() then
'x.process() will return true if the transaction server accepted the request and attempted to process the transaction
dim y as p
dim result_msg as c
dim result_title as c = ""
y = x.result
result_msg = y.Response_Reason_Text
if (y.response_code = "1")
' Authorize.Net defines response code 1 as "Approved"
result_title = "Approved"
*concat(result_msg,crlf()+ "Approval Code: " + y.Approval_Code)
elseif (y.response_code = "2")
'Authorize.Net defines response code 2 as "Declined"
result_title = "declined"
elseif (y.response_code = "3")
'Authorize.Net defines response code 3 as "Error"
result_title = "error"
end if
*concat(result_title," " + "Transaction " + y.Transaction_ID)
ui_msg_box(result_title,result_msg)
else
'if x.process() is false, the transaction server could not be contacted or did not respond in a timely manner
ui_msg_box("", "Transaction NOT processed", UI_ATTENTION_SYMBOL)
end if
Comment