We are having some issues handeling the return transactionResponse to detect failed Transactions. At first we were just tesing for a response code of 2, but found that a decline isnt the only return for a failed transaction. So we decided to go with testing if the authcode was all 0s, or null to check for failed transactions. That does not seem to work as a declined transaction came back with a authCode that was neither all zeros or null but a six digit integer. What different scenarios and checks would we need to do to detect a failed authorization? C# sample code:
if(response.messages.resultCode == messageTypeEnum.Error) throw new Exception("OrderCreditCardController.CapturePayment: " + GetResponseMessage(response));
AuthorizeCode = response.transactionResponse.authCode;
//checks for null and All zeros
if (!IsAuthorizeCodeValid(AuthorizeCode)) throw new Exception("OrderCreditCardController.AuthorizePayment:" + response.transactionResponse.responseCode + " " + GetResponseMessage(response));
04-06-2018 01:30 PM
Why not check if the responseCode is !=1 for a declined transaction or transId > 0 for an approved transaction?
04-07-2018 02:08 PM - edited 04-07-2018 02:18 PM
@johnnyc wrote:We are having some issues handeling the return transactionResponse to detect failed Transactions. At first we were just tesing for a response code of 2, but found that a decline isnt the only return for a failed transaction. So we decided to go with testing if the authcode was all 0s, or null to check for failed transactions. That does not seem to work as a declined transaction came back with a authCode that was neither all zeros or null but a six digit integer. What different scenarios and checks would we need to do to detect a failed authorization? C# sample code:
if(response.messages.resultCode == messageTypeEnum.Error) throw new Exception("OrderCreditCardController.CapturePayment: " + GetResponseMessage(response));
AuthorizeCode = response.transactionResponse.authCode;
//checks for null and All zeros
if (!IsAuthorizeCodeValid(AuthorizeCode)) throw new Exception("OrderCreditCardController.AuthorizePayment:" + response.transactionResponse.responseCode + " " + GetResponseMessage(response));
Thank goodness i have found someone else experiencing the same problem.
10-11-2018 03:22 AM