cancel
Showing results for 
Search instead for 
Did you mean: 

A Required Key Missing in the Configuration Dictionary Object Passed to the instance of MerchantConf

Hello. I am taking the first steps to integrate CyberSource into our internet shop application. I am using the C# API as pulled from github. When calling

var configDictionary = new CyberSourceConfiguration(Configuration).GetConfiguration();
var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);
var apiInstance = new PaymentsApi(clientConfig);
PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj);

I am getting the error message "A Required Key Missing in the Configuration Dictionary Object Passed to the instance of MerchantConfig Object". The error message does not give me any indication of *what* key is missing.

The GetConfiguration() function is copied from the Sample Code available on github, with our values substituted in for merchantId, merchantsecretKey, and merchantKeyId:

_configurationDictionary.Add("authenticationType", "HTTP_SIGNATURE");
_configurationDictionary.Add("merchantID", OUR_MERCH_ID);
_configurationDictionary.Add("merchantsecretKey", OUR_SECRET_KEY);
_configurationDictionary.Add("merchantKeyId", OUR_PUBLIC_KEY);
_configurationDictionary.Add("keysDirectory", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\Source\\Resource"));
_configurationDictionary.Add("keyFilename", "EIS_Cybersource");
_configurationDictionary.Add("runEnvironment", _shopConfig.ReadBoolean("CYBERSOURCE_USE_SANDBOX", true) ? "apitest.cybersource.com" : "api.cybersource.com");
_configurationDictionary.Add("keyAlias", "EIS_Cybersource");
_configurationDictionary.Add("keyPass", "EIS_Cybersource");
_configurationDictionary.Add("timeout", "300000");

// Configs related to meta key
_configurationDictionary.Add("portfolioID", string.Empty);
_configurationDictionary.Add("useMetaKey", "false");

// Configs related to OAuth
_configurationDictionary.Add("enableClientCert", "false");
_configurationDictionary.Add("clientCertDirectory", "Resource");
_configurationDictionary.Add("clientCertFile", "");
_configurationDictionary.Add("clientCertPassword", "");
_configurationDictionary.Add("clientId", "");
_configurationDictionary.Add("clientSecret", "");

How can I determine *what* key is missing from this configuration dictionary? I am not able to find any documentation on the configuration on the CyberSource website, beyond links to the Sample Code on github.

Thank you for your time

dtp_paul
Member
0 REPLIES 0