Skip to content
New issue

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

NVP Client Type conversion error when logging and passing in non-string values #58

Open
joesolano opened this issue Oct 13, 2020 · 0 comments

Comments

@joesolano
Copy link

When using the NVP Client and passing in values which are not strings the client successfully processes the transactions fine. If you enable logging then the logger fails with a type conversion error:
"Unable to cast object of type 'System.Double' to type 'System.String'."
StackTrace " at CyberSource.Base.Logger.GetLogString(MessageType type, Hashtable table)\r\n at CyberSource.Base.Logger.LogRequest(Hashtable request, Boolean demo)\r\n at CyberSource.Clients.NVPClient.RunTransaction(Configuration config, Hashtable request)\r\n

To reproduce this change the following line in the NVPSample.cs
request.Add( "item_0_unitPrice", "12.34" );
to
request.Add( "item_0_unitPrice", 12.34);

And enable logging in the config:

I would have expected either the transaction to fail when passing in non-string values OR the logger to succeed when passing in non-string values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant