Skip to content

Commit 00fc5cf

Browse files
authored
Merge pull request #63 from Nitinsl/Feature-F205651-V12.30
Feature f205651 v12.30
2 parents 1e1f491 + b2bd528 commit 00fc5cf

File tree

8 files changed

+673
-4
lines changed

8 files changed

+673
-4
lines changed

CnpSdkForNet/CnpSdkForNet/CnpSdkForNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<SignAssembly>true</SignAssembly>
55
<AssemblyOriginatorKeyFile>dotNetSDKKey.snk</AssemblyOriginatorKeyFile>
6-
<PackageVersion>12.27.0</PackageVersion>
6+
<PackageVersion>12.30.0</PackageVersion>
77
<Title>Vantiv.CnpSdkForNet</Title>
88
<Authors>FIS</Authors>
99
<Copyright>Copyright © FIS 2020</Copyright>

CnpSdkForNet/CnpSdkForNet/CnpVersion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Cnp.Sdk
88
*/
99
public class CnpVersion
1010
{
11-
public const String CurrentCNPXMLVersion = "12.27";
12-
public const String CurrentCNPSDKVersion = "12.27.0";
11+
public const String CurrentCNPXMLVersion = "12.30";
12+
public const String CurrentCNPSDKVersion = "12.30.0";
1313
}
1414
}

CnpSdkForNet/CnpSdkForNet/XmlRequestFields.cs

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ public long surchargeAmount
281281
}
282282
public orderSourceType orderSource;
283283
public customerInfo customerInfo;
284+
public sellerInfo sellerInfo;//12.29
284285
public contact billToAddress;
285286
public contact retailerAddress;///12.24
286287
public additionalCOFData additionalCOFData;
@@ -531,6 +532,25 @@ public fraudSwitchIndicatorEnum fraudSwitchIndicator
531532
}
532533
public passengerTransportData passengerTransportData;
533534
//12.25 and 12.26 end
535+
536+
//12.30 start
537+
private authIndicatorEnum authIndicatorField;
538+
private bool authIndicatorSet;
539+
public authIndicatorEnum authIndicator
540+
{
541+
get
542+
{
543+
return authIndicatorField;
544+
}
545+
set
546+
{
547+
authIndicatorField = value;
548+
authIndicatorSet = true;
549+
}
550+
}
551+
552+
//12.30 end
553+
534554
public bool? skipRealtimeAU;
535555

536556
public string merchantCategoryCode;
@@ -547,6 +567,8 @@ public override string Serialize()
547567
if (cnpTxnIdSet)
548568
{
549569
xml += "\r\n<cnpTxnId>" + cnpTxnIdField + "</cnpTxnId>";
570+
xml += "\r\n<amount>" + amount + "</amount>";
571+
xml += "\r\n<authIndicator>" + authIndicatorField + "</authIndicator>";
550572
}
551573
else
552574
{
@@ -560,6 +582,10 @@ public override string Serialize()
560582
{
561583
xml += "\r\n<customerInfo>" + customerInfo.Serialize() + "\r\n</customerInfo>";
562584
}
585+
if (sellerInfo != null)
586+
{
587+
xml += "\r\n<sellerInfo>" + sellerInfo.Serialize() + "\r\n</sellerInfo>";
588+
}
563589
if (billToAddress != null)
564590
{
565591
xml += "\r\n<billToAddress>" + billToAddress.Serialize() + "\r\n</billToAddress>";
@@ -694,6 +720,15 @@ public override string Serialize()
694720
xml += "\r\n<passengerTransportData>" + passengerTransportData.Serialize() + "\r\n</passengerTransportData>";
695721
}
696722
//end
723+
724+
//12.30 start
725+
726+
if (authIndicatorSet)
727+
{
728+
xml += "\r\n<authIndicator>" + authIndicatorField + "</authIndicator>";
729+
}
730+
//end
731+
697732
if (merchantData != null)
698733
{
699734
xml += "\r\n<merchantData>" + merchantData.Serialize() + "\r\n</merchantData>";
@@ -2607,6 +2642,7 @@ public long surchargeAmount
26072642
}
26082643
public orderSourceType orderSource;
26092644
public customerInfo customerInfo;
2645+
public sellerInfo sellerInfo;//12.29
26102646
public contact billToAddress;
26112647
public contact retailerAddress;///12.24
26122648
public contact shipToAddress;
@@ -2907,6 +2943,10 @@ public override string Serialize()
29072943
{
29082944
xml += "\r\n<customerInfo>" + customerInfo.Serialize() + "\r\n</customerInfo>";
29092945
}
2946+
if (sellerInfo != null)
2947+
{
2948+
xml += "\r\n<sellerInfo>" + sellerInfo.Serialize() + "\r\n</sellerInfo>";
2949+
}
29102950
if (billToAddress != null)
29112951
{
29122952
xml += "\r\n<billToAddress>" + billToAddress.Serialize() + "\r\n</billToAddress>";
@@ -3720,6 +3760,7 @@ public enum orderChannelEnum
37203760
SOCIAL,
37213761
MARKETPLACE,
37223762
IN_STORE_KIOSK,
3763+
MIT// new 12.28
37233764
}
37243765

37253766
//new 12.25, 12.26 and 12.27 start
@@ -3791,6 +3832,14 @@ public enum walletSourceType
37913832
}
37923833
//12.25, 12.26 and 12.27 end
37933834

3835+
//new 12.28, 12.29 and 12.30 start
3836+
public enum authIndicatorEnum
3837+
{
3838+
Estimated,
3839+
Incremental
3840+
}
3841+
3842+
37943843
#endregion
37953844

37963845
#region Child elements.
@@ -4458,7 +4507,7 @@ public partial class cardTokenType
44584507
public string tokenUrl;
44594508
public string expDate;
44604509
public string cardValidationNum;
4461-
private string authenticatedShopperID;
4510+
private string authenticatedShopperID;
44624511
private methodOfPaymentTypeEnum typeField;
44634512
private bool typeSet;
44644513
public methodOfPaymentTypeEnum type
@@ -6211,6 +6260,106 @@ public string Serialize()
62116260
}
62126261
}
62136262

6263+
//12.29
6264+
public partial class sellerInfo
6265+
{
6266+
public string accountNumber;
6267+
private int aggregateOrderCountField;
6268+
private bool aggregateOrderCountSet;
6269+
public int aggregateOrderCount
6270+
{
6271+
get { return aggregateOrderCountField; }
6272+
set { aggregateOrderCountField = value; aggregateOrderCountSet = true; }
6273+
}
6274+
6275+
private int aggregateOrderDollarsField;
6276+
private bool aggregateOrderDollarsSet;
6277+
6278+
public int aggregateOrderDollars
6279+
{
6280+
get { return aggregateOrderDollarsField; }
6281+
set { aggregateOrderDollarsField = value; aggregateOrderDollarsSet = true; }
6282+
}
6283+
public sellerAddress sellerAddress;
6284+
public string createdDate;
6285+
public string domain;
6286+
public string email;
6287+
public string lastUpdateDate;
6288+
public string name;
6289+
public string onboardingEmail;
6290+
public string onboardingIpAddress;
6291+
public string parentEntity;
6292+
public string phone;
6293+
public string sellerId;
6294+
public sellerTagsType sellerTags;
6295+
public string username;
6296+
6297+
public string Serialize()
6298+
{
6299+
var xml = "";
6300+
if (accountNumber != null) xml += "\r\n<accountNumber>" + SecurityElement.Escape(accountNumber) + "</accountNumber>";
6301+
if (aggregateOrderCountSet) xml += "\r\n<aggregateOrderCount>" + aggregateOrderCountField + "</aggregateOrderCount>";
6302+
if (aggregateOrderDollarsSet) xml += "\r\n<aggregateOrderDollars>" + aggregateOrderDollarsField + "</aggregateOrderDollars>";
6303+
if (sellerAddress != null)
6304+
{
6305+
xml += "\r\n<sellerAddress>" + sellerAddress.Serialize() + "\r\n</sellerAddress>";
6306+
}
6307+
return xml;
6308+
if (createdDate != null) xml += "\r\n<createdDate>" + SecurityElement.Escape(createdDate) + "</createdDate>";
6309+
if (domain != null) xml += "\r\n<domain>" + SecurityElement.Escape(domain) + "</domain>";
6310+
if (email != null) xml += "\r\n<email>" + SecurityElement.Escape(email) + "</email>";
6311+
if (lastUpdateDate != null) xml += "\r\n<lastUpdateDate>" + SecurityElement.Escape(lastUpdateDate) + "</lastUpdateDate>";
6312+
if (name != null) xml += "\r\n<name>" + SecurityElement.Escape(name) + "</name>";
6313+
if (onboardingEmail != null) xml += "\r\n<onboardingEmail>" + SecurityElement.Escape(onboardingEmail) + "</onboardingEmail>";
6314+
if (onboardingIpAddress != null) xml += "\r\n<onboardingIpAddress>" + SecurityElement.Escape(onboardingIpAddress) + "</onboardingIpAddress>";
6315+
if (parentEntity != null) xml += "\r\n<parentEntity>" + SecurityElement.Escape(parentEntity) + "</parentEntity>";
6316+
if (phone != null) xml += "\r\n<phone>" + SecurityElement.Escape(phone) + "</phone>";
6317+
if (sellerId != null) xml += "\r\n<sellerId>" + SecurityElement.Escape(sellerId) + "</sellerId>";
6318+
if (sellerTags != null)
6319+
{
6320+
xml += "\r\n<sellerTags>" + sellerTags.Serialize() + "\r\n</sellerTags>";
6321+
}
6322+
if (username != null) xml += "\r\n<username>" + SecurityElement.Escape(username) + "</username>";
6323+
6324+
return xml;
6325+
}
6326+
6327+
}
6328+
6329+
public partial class sellerAddress
6330+
{
6331+
public string sellerStreetaddress;
6332+
public string sellerUnit;
6333+
public string sellerPostalcode;
6334+
public string sellerCity;
6335+
public string sellerProvincecode;
6336+
public string sellerCountrycode;
6337+
6338+
public string Serialize()
6339+
{
6340+
var xml = "";
6341+
if (sellerStreetaddress != null) xml += "\r\n<sellerStreetaddress>" + SecurityElement.Escape(sellerStreetaddress) + "</sellerStreetaddress>";
6342+
if (sellerUnit != null) xml += "\r\n<sellerUnit>" + SecurityElement.Escape(sellerUnit) + "</sellerUnit>";
6343+
if (sellerPostalcode != null) xml += "\r\n<sellerPostalcode>" + SecurityElement.Escape(sellerPostalcode) + "</sellerPostalcode>";
6344+
if (sellerCity != null) xml += "\r\n<sellerCity>" + SecurityElement.Escape(sellerCity) + "</sellerCity>";
6345+
if (sellerProvincecode != null) xml += "\r\n<sellerProvincecode>" + SecurityElement.Escape(sellerProvincecode) + "</sellerProvincecode>";
6346+
if (sellerCountrycode != null) xml += "\r\n<sellerCountrycode>" + SecurityElement.Escape(sellerCountrycode) + "</sellerCountrycode>";
6347+
return xml;
6348+
}
6349+
}
6350+
6351+
public partial class sellerTagsType
6352+
{
6353+
public string tag;
6354+
6355+
public string Serialize()
6356+
{
6357+
var xml = "";
6358+
if (tag != null) xml += "\r\n<tag>" + SecurityElement.Escape(tag) + "</tag>";
6359+
return xml;
6360+
}
6361+
}
6362+
62146363
public partial class propertyAddress
62156364
{
62166365
public string name;

CnpSdkForNet/CnpSdkForNetTest/Functional/TestAuth.cs

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,5 +1144,139 @@ public void SimpleAuthWithAuthMaxNotApplied() //12.27
11441144
Assert.AreEqual(false, response.authMax.authMaxApplied);
11451145
Assert.AreEqual(checkDate, response.postDate);
11461146
}
1147+
1148+
//12.28,12.29 and 12.30 start
1149+
[Test]
1150+
public void SimpleAuthWithOrdChanelEnumMIT()
1151+
{
1152+
var authorization = new authorization
1153+
{
1154+
id = "1",
1155+
reportGroup = "Planets",
1156+
orderId = "12344",
1157+
amount = 106,
1158+
orderSource = orderSourceType.ecommerce,
1159+
authIndicator = authIndicatorEnum.Estimated,
1160+
card = new cardType
1161+
{
1162+
type = methodOfPaymentTypeEnum.VI,
1163+
number = "414100000000000000",
1164+
expDate = "1210"
1165+
},
1166+
customBilling = new customBilling { phone = "1112223333" },
1167+
orderChannel = orderChannelEnum.MIT
1168+
};
1169+
var response = _cnp.Authorize(authorization);
1170+
1171+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
1172+
1173+
Assert.AreEqual("000", response.response);
1174+
Assert.AreEqual(checkDate, response.postDate);
1175+
}
1176+
1177+
[Test]
1178+
public void SimpleAuthWithSellerInfo()
1179+
{
1180+
var authorization = new authorization
1181+
{
1182+
id = "1",
1183+
reportGroup = "Planets",
1184+
orderId = "12344",
1185+
amount = 106,
1186+
orderSource = orderSourceType.ecommerce,
1187+
card = new cardType
1188+
{
1189+
type = methodOfPaymentTypeEnum.VI,
1190+
number = "414100000000000000",
1191+
expDate = "1210"
1192+
},
1193+
customBilling = new customBilling { phone = "1112223333" },
1194+
sellerInfo = new sellerInfo
1195+
{
1196+
accountNumber = "4485581000000005",
1197+
aggregateOrderCount = 4,
1198+
aggregateOrderDollars = 100000,
1199+
sellerAddress = new sellerAddress
1200+
{
1201+
sellerStreetaddress = "15 Main Street",
1202+
sellerUnit = "100 AB",
1203+
sellerPostalcode = "12345",
1204+
sellerCity = "San Jose",
1205+
sellerProvincecode = "MA",
1206+
sellerCountrycode = "US"
1207+
},
1208+
createdDate = "2015-11-12T20:33:09",
1209+
domain = "vap",
1210+
email = "bob@example.com",
1211+
lastUpdateDate = "2015-11-12T20:33:09",
1212+
name = "bob",
1213+
onboardingEmail = "bob@example.com",
1214+
onboardingIpAddress = "75.100.88.78",
1215+
parentEntity = "abc",
1216+
phone = "9785510040",
1217+
sellerId = "123456789",
1218+
sellerTags = new sellerTagsType
1219+
{
1220+
tag = "2"
1221+
},
1222+
username = "bob123"
1223+
}
1224+
};
1225+
var response = _cnp.Authorize(authorization);
1226+
1227+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
1228+
1229+
Assert.AreEqual("000", response.response);
1230+
Assert.AreEqual(checkDate, response.postDate);
1231+
}
1232+
1233+
[Test]
1234+
public void SimpleAuthWithAuthIndicatorWithEstimatedEnum()
1235+
{
1236+
var authorization = new authorization
1237+
{
1238+
id = "1",
1239+
reportGroup = "Planets",
1240+
orderId = "12344",
1241+
amount = 106,
1242+
orderSource = orderSourceType.ecommerce,
1243+
authIndicator = authIndicatorEnum.Estimated,
1244+
card = new cardType
1245+
{
1246+
type = methodOfPaymentTypeEnum.VI,
1247+
number = "414100000000000000",
1248+
expDate = "1210"
1249+
},
1250+
customBilling = new customBilling { phone = "1112223333" }
1251+
};
1252+
var response = _cnp.Authorize(authorization);
1253+
1254+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
1255+
1256+
Assert.AreEqual("000", response.response);
1257+
Assert.AreEqual(checkDate, response.postDate);
1258+
}
1259+
1260+
[Test]
1261+
public void SimpleAuthWithAuthIndicatorWithIncreamentalEnum()
1262+
{
1263+
var authorization = new authorization
1264+
{
1265+
id = "1",
1266+
customerId = "CustId",
1267+
reportGroup = "Planets",
1268+
cnpTxnId = 901097991325067135,
1269+
amount = 106,
1270+
authIndicator = authIndicatorEnum.Incremental,
1271+
1272+
};
1273+
var response = _cnp.Authorize(authorization);
1274+
1275+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
1276+
1277+
Assert.AreEqual("000", response.response);
1278+
Assert.AreEqual(checkDate, response.postDate);
1279+
}
1280+
//12.28,12.29 and 12.30 end
11471281
}
11481282
}

0 commit comments

Comments
 (0)