-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Dear All,
I am getting this issue in qa environment locally it works fine. Request and config all same in local env and qa environment. I am stuck in this check all the possibility but still getting null issue in QA while code reach this line "var data = apiInstance.CreateSearch(requestObj);"
below is request and response.
Request :
private CyberSource.Model.TssV2TransactionsPost201Response CreateCyberSourceSearch(string item)
{
try
{
var requestObj = new CyberSource.Model.CreateSearchRequest()
{
Save = false,
Name = "TSS search",
Timezone = "Asia/Dubai",
Query = string.Format("{0}:{1}", "clientReferenceInformation.code", item),
Offset = 0,
Limit = 10,
Sort = "id:asc, submitTimeUtc:asc"
};
var configDictionary = new CyberSourceConfiguration(false).GetConfiguration();
var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);
var apiInstance = new SearchTransactionsApi(clientConfig);
if (apiInstance != null)
{
_logger.LogInformation("apiInstance: " + JsonConvert.SerializeObject(apiInstance.Configuration.ClientId));
}
else
{
_logger.LogError("apiInstance is null");
}
var data = apiInstance.CreateSearch(requestObj);
if (data != null)
{
_logger.LogInformation("data: " + JsonConvert.SerializeObject(data));
}
else
{
_logger.LogError("data is null");
}
return data;
}
catch (Exception ex)
{
_logger.LogError("Exception on calling the API: " + ex.Message);
return null;
}
}
Response :
Error Occurred in CreateSearchRequest method: Value cannot be null. (Parameter 'source')-- at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at CyberSource.Client.ApiClient.CallApi(String path, Method method, Dictionary2 queryParams, Object postBody, Dictionary2 headerParams, Dictionary2 formParams, Dictionary2 fileParams, Dictionary2 pathParams, String contentType, Boolean isResponseMLEForApi) at CyberSource.Api.SearchTransactionsApi.CreateSearchWithHttpInfo(CreateSearchRequest createSearchRequest) at CyberSource.Api.SearchTransactionsApi.CreateSearch(CreateSearchRequest createSearchRequest)