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

Payment Connector throws System.NullReferenceException when using CardPaymentManager with CommerceSDK #323

Open
ja1m1n8hatt opened this issue Sep 26, 2024 · 0 comments

Comments

@ja1m1n8hatt
Copy link

Other Development Issue

Summary

Describe the issue
We have a Payment Connector that works with RetailSDK in our current implementation. We have migrated the source code to CommerceSDK and are able to compile successfully. This payment connector uses Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardPaymentManager.GetPaymentProcessor during BeginTransactionAsync in PaymentDevice implementation. It also uses this library in other Payment Device methods. The CardPaymentManager is not available as a part of the CommerceSDK nuget packages, however, we were able to locate it within RetailSDK local nuget references and import them to build successfully. When executing the Store Commerce App, it throws the null reference exception. Please see full trace below. Most documentation for payment connector still points to RetailSDK and there are not enough samples or documentation for CommerceSDK for payment connectors. We would like to know why CardPaymentManager is throwing errors and if there is an alternate implementation or library that needs to be used with CommerceSDK.

Version and Error Info
Commerce SDK Component: Payment Connector
Component Version:
Commerce SDK Version: 9.47
Exception/Error Details:

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Dynamics.Commerce.HardwareStation.CardPayment
StackTrace:
at Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardPaymentManager.d__58.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardPaymentManager.d__18.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at DXC.PaymentConnector.VerifoneSCA.PaymentDevice.d__68.MoveNext() in C:\DXXXXXTS\EXS\src\EXS\DXX.PaymentConnector.VerifoneSCA\DXX.PaymentConnector.VerifoneSCA.PaymentDevice\PaymentDevice.cs:line 976

This exception was originally thrown at this call stack:
Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardPaymentManager.LoadConnectors(Microsoft.Dynamics.Commerce.Runtime.RequestContext, System.Collections.Generic.List)
Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardPaymentManager.GetPaymentProcessor(Microsoft.Dynamics.Retail.PaymentSDK.Portable.PaymentProperty[], string, Microsoft.Dynamics.Commerce.Runtime.RequestContext)
DXX.PaymentConnector.VerifoneSCA.PaymentDevice.BeginTransactionAsync(Microsoft.Dynamics.Commerce.HardwareStation.BeginTransactionPaymentTerminalDeviceRequest, Microsoft.Dynamics.Retail.PaymentSDK.Portable.PaymentProperty[], string, string, bool) in PaymentDevice.cs

Reproducing the Issue

Link to GitHub repo/solution where the issue is reproducible:
GitHub samples for payment device sample do not contain the extent of code that can be used to reproduce a real life payment device interaction. Please provide guidance on what further data or information I can provide to assist.

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Run command '....'
  4. See error

Screenshots

Please include any screenshots that would help us understand the issue.

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

No branches or pull requests

1 participant