Replies: 1 comment 1 reply
-
Hi, imho your approach is too much of a hassle. I'd suggest to implement your payment connector logging needs into Application Insights. It's a really straightforward approach and you can customize your logging columns on a need-to-have basis. |
Beta Was this translation helpful? Give feedback.
1 reply
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 which is a C# class based on the 'INamedRequestHandler' (payment device) and which is present in my 'Hardwarestation' project.
Within this connector (C# class) I want to write data to a custom table (for logging purposes) by means of calling a stored procedure as follows:
using (var databaseContext = new Microsoft.Dynamics.Commerce.Runtime.DataAccess.SqlServer.SqlServerDatabaseContext(reqContext))
{
Microsoft.Dynamics.Commerce.Runtime.ParameterSet parameters = new Microsoft.Dynamics.Commerce.Runtime.ParameterSet();
parameters["@REQTYPE"] = reqType;
parameters["@handled"] = handled;
etc..........................
await databaseContext.ExecuteStoredProcedureNonQueryAsync("[ext].[ExternalGiftCardLogInsert]", parameters, resultSettings: null).ConfigureAwait(false);
The variable 'reqContext' is coming from my 'Request' object ('Request.RequestContext'), for example like follows:
private async Task[PaymentInfo] GetGiftCardBalanceAsync(GetGiftCardBalancePaymentTerminalRequest request)
The requirement is there from our customer to log every call we make to the payment provider (request/response) with all kind of detailed data from the payment provider. I can build and deploy my solution locally on my dev environment and when I run the store commerce app and debug and the debuuger executes the below line of code then I get an error message saying "An implementation of IDatabaseProvider must be composed"
using (var databaseContext = new Microsoft.Dynamics.Commerce.Runtime.DataAccess.SqlServer.SqlServerDatabaseContext(reqContext))
How can I solve this error message? - Is it even possible to connect to the database from within a payment connector? - If it's not possible then what are my alternatives, cause we need the logging data?
Thx in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions