Skip to content

Commit a6936d5

Browse files
committed
adding changes for merchant config developerId
1 parent 0c14f15 commit a6936d5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Utilities/Tracking/SdkTracker.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace CyberSource.Utilities.Tracking
1010
{
1111
public interface ISdkTracker
1212
{
13-
object InsertDeveloperIdTracker(object requestObj, string requestClass, string runEnvironment);
13+
object InsertDeveloperIdTracker(object requestObj, string requestClass, string runEnvironment, string defaultMerchantConfigDeveloperId);
1414
}
1515

1616
public partial class SdkTracker : ISdkTracker
1717
{
18-
public object InsertDeveloperIdTracker(object requestObj, string requestClass, string runEnvironment)
18+
public object InsertDeveloperIdTracker(object requestObj, string requestClass, string runEnvironment, string defaultMerchantConfigDeveloperId)
1919
{
2020
string developerIdValue;
2121
if (runEnvironment.Contains("apitest.cybersource.com"))
@@ -27,6 +27,12 @@ public object InsertDeveloperIdTracker(object requestObj, string requestClass, s
2727
developerIdValue = "JZKVPX48";
2828
}
2929

30+
if (!string.IsNullOrEmpty(defaultMerchantConfigDeveloperId))
31+
{
32+
defaultMerchantConfigDeveloperId = defaultMerchantConfigDeveloperId.Trim();
33+
developerIdValue = !string.IsNullOrEmpty(defaultMerchantConfigDeveloperId) ? defaultMerchantConfigDeveloperId : developerIdValue;
34+
}
35+
3036
switch (requestClass)
3137
{
3238
case "CapturePaymentRequest":

generator/cybersource-csharp-template/api.mustache

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ namespace {{packageName}}.{{apiPackage}}
316316
if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[]))
317317
{
318318
SdkTracker sdkTracker = new SdkTracker();
319-
{{paramName}} = ({{{dataType}}})sdkTracker.InsertDeveloperIdTracker({{paramName}}, {{paramName}}.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"]);
319+
{{paramName}} = ({{{dataType}}})sdkTracker.InsertDeveloperIdTracker({{paramName}}, {{paramName}}.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"], Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj.ContainsKey("defaultDeveloperId")? Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["defaultDeveloperId"]:"");
320320
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
321321
}
322322
else
@@ -506,7 +506,7 @@ namespace {{packageName}}.{{apiPackage}}
506506
if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[]))
507507
{
508508
SdkTracker sdkTracker = new SdkTracker();
509-
{{paramName}} = ({{{dataType}}})sdkTracker.InsertDeveloperIdTracker({{paramName}}, {{paramName}}.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"]);
509+
{{paramName}} = ({{{dataType}}})sdkTracker.InsertDeveloperIdTracker({{paramName}}, {{paramName}}.GetType().Name, Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["runEnvironment"], Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj.ContainsKey("defaultDeveloperId")? Configuration.ApiClient.Configuration.MerchantConfigDictionaryObj["defaultDeveloperId"]:"");
510510
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
511511
}
512512
else

0 commit comments

Comments
 (0)