How to retrieve the channel, device, user etc. from with a payment conector #290
Unanswered
ahgamal-ms
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a payment connector (payment device) which is a C# class that implements 'INamedRequestHandler'.
I use for example the method 'GetGiftCardBalanceAsync' and I try to find things like the channel, device, userId, staffId etc. I thought I needed the request.RequestContext object for that but all the related fields/properties are empty. See below a piece of code as example:
GetGiftCardBalanceAsync(GetGiftCardBalancePaymentTerminalRequest request)
{
string tmp;
long tmpLong;
tmpLong = request.RequestContext.Runtime.CurrentPrincipal.ChannelId;
tmp = request.RequestContext.Runtime.CurrentPrincipal.DeviceNumber;
//tmp = request.RequestContext.GetDeviceConfiguration().StoreNumber;
tmp = request.RequestContext.Runtime.CurrentPrincipal.UserId;
//tmp = request.RequestContext.GetChannelConfiguration().InventLocationDataAreaId;
Microsoft.Dynamics.Commerce.Runtime.ICommercePrincipal principal = request.RequestContext.GetPrincipal();
Is it even possible to get this kind of data from within a payment device class (INamedRequestHandler)?
Thx in advance.
Beta Was this translation helpful? Give feedback.
All reactions