We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When charging a card twice with the same amount in the same minute cardknox rejects the charge with a 'Duplicate charge' error message
for some reason, the response has in it the xAvsResultCode key but its empty.
now, since the parsing code is not handled for exceptions this line raises an exception
AvsResultCode = (AvsResponseType)Enum.Parse(typeof(AvsResponseType), _values["xAvsResultCode"]);
Please update the CardknoxResponse constructor to handle exceptions like this
CardknoxResponse
here is my 2 cents
` public CardknoxResponse(NameValueCollection _values) { if (_values.AllKeys.Contains("xResult")) { try { Result = (ResultType)Enum.Parse(typeof(ResultType), _values["xResult"]); } catch { } }
if (_values.AllKeys.Contains("xError")) Error = _values["xError"]; if (_values.AllKeys.Contains("xErrorCode")) ErrorCode = _values["xErrorCode"]; if (_values.AllKeys.Contains("xStatus")) Status = (StatusType)Enum.Parse(typeof(StatusType), _values["xStatus"]); if (_values.AllKeys.Contains("xRefNum")) RefNum = _values["xRefNum"]; if (_values.AllKeys.Contains("xAuthCode")) AuthCode = _values["xAuthCode"]; if (_values.AllKeys.Contains("xBatch")) Batch = _values["xBatch"]; if (_values.AllKeys.Contains("xAvsResultCode")) { try { AvsResultCode = (AvsResponseType)Enum.Parse(typeof(AvsResponseType), _values["xAvsResultCode"]); } catch { } } if (_values.AllKeys.Contains("xAvsResult")) { try { AvsResult = HttpUtility.UrlDecode(_values["xAvsResult"]); } catch { } } if (_values.AllKeys.Contains("xAuthAmount")) { try { AuthAmount = Decimal.Parse(_values["xAuthAmount"]); } catch { } } else AuthAmount = null; if (_values.AllKeys.Contains("xMaskedCardNumber")) MaskedCardNumber = _values["xMaskedCardNumber"]; if (_values.AllKeys.Contains("xCardType")) { try { CardType = (CardType)Enum.Parse(typeof(CardType), _values["xCardType"]); } catch { } } if (_values.AllKeys.Contains("xToken")) Token = _values["xToken"]; if (_values.AllKeys.Contains("xEntryMethod")) EntryMethod = _values["xEntryMethod"];
} `
The text was updated successfully, but these errors were encountered:
You make a great point!
Sorry, something went wrong.
e8be33e
The fix for this is now live in 4.5.3.
Thanks!
ahwm
No branches or pull requests
When charging a card twice with the same amount in the same minute cardknox rejects the charge with a 'Duplicate charge' error message
for some reason, the response has in it the xAvsResultCode key but its empty.
now, since the parsing code is not handled for exceptions this line raises an exception
AvsResultCode = (AvsResponseType)Enum.Parse(typeof(AvsResponseType), _values["xAvsResultCode"]);
Please update the
CardknoxResponse
constructor to handle exceptions like thishere is my 2 cents
` public CardknoxResponse(NameValueCollection _values)
{
if (_values.AllKeys.Contains("xResult"))
{
try
{
Result = (ResultType)Enum.Parse(typeof(ResultType), _values["xResult"]);
}
catch { }
}
} `
The text was updated successfully, but these errors were encountered: