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.