Skip to content

Commit 2b20690

Browse files
Feature f225322 v12.33 (#69)
* promoting code changes * Committing test changes for v12.33 * committing test change * commiting test changes and changelog --------- Co-authored-by: Nitinsl <nitinlingayat.sh@gmail.com>
1 parent 1a34671 commit 2b20690

21 files changed

+1161
-29
lines changed

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11

22
= Worldpay CNP CHANGELOG
33

4+
==Version: 12.33.0 (Jan 09, 2024)
5+
Note: It contains changes from cnpAPI v12.32 and v12.33. In case you need any feature supported by cnpAPI v12.32 and v12.33.please use SDK version 12.33.0.
6+
7+
* Change: [cnpAPI v12.33] Added new simple types numberOfPeriods of type digit,string10Type
8+
* Change: [cnpAPI v12.33] Added new simple element shipmentId
9+
* Change: [cnpAPI v12.33] new complex element subscription is added with few simple elements subscriptionId ,nextDeliveryDate ,periodUnit ,numberOfPeriods ,regularItemPrice ,currentPeriod
10+
* Change: [cnpAPI v12.33] Added new Enum periodUnit of type enum with values WEEK,MONTH,QUARTER,YEAR
11+
* Change: [cnpAPI v12.32] simple type of customerIpAddress is changed from ipAddress to newly added simpletype stringipAddress
12+
413
==Version 12.31.0 (July 11, 2023)
514
Note : It contains changes from cnpAPI v12.31. In case you need any feature supported by cnpAPI v12.31, please use SDK version 12.31.0
615
* Change: [cnpAPI v12.31] Added new Enum foreignRetailerIndicatorEnum with value F

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.31.0</PackageVersion>
6+
<PackageVersion>12.33.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.31";
12-
public const String CurrentCNPSDKVersion = "12.31.0";
11+
public const String CurrentCNPXMLVersion = "12.33";
12+
public const String CurrentCNPSDKVersion = "12.33.0";
1313
}
1414
}

CnpSdkForNet/CnpSdkForNet/XmlRequestFields.cs

Lines changed: 100 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,7 @@ public int surchargeAmount
871871
set { surchargeAmountField = value; surchargeAmountIsSet = true; }
872872
}
873873

874-
private bool enhancedDataIsSet;
875-
private enhancedData enhancedDataField;
876-
public enhancedData enhancedData
877-
{
878-
get { return enhancedDataField; }
879-
set { enhancedDataField = value; enhancedDataIsSet = true; }
880-
}
874+
public enhancedData enhancedData;
881875

882876
private bool processingInstructionsIsSet;
883877
private processingInstructions processingInstructionsField;
@@ -937,11 +931,11 @@ public override string Serialize()
937931
xml += this.customBillingField.Serialize();
938932
}
939933

940-
if (this.enhancedDataIsSet)
934+
if (enhancedData != null)
941935
{
942-
xml += this.enhancedDataField.Serialize();
936+
xml += "\r\n<enhancedData>" + enhancedData.Serialize() + "\r\n</enhancedData>";
943937
}
944-
938+
945939
if (this.lodgingInfoIsSet)
946940
{
947941
xml += this.lodgingInfoField.Serialize();
@@ -992,14 +986,8 @@ public int surchargeAmount
992986
set { surchargeAmountField = value; surchargeAmountIsSet = true; }
993987
}
994988

995-
private bool enhancedDataIsSet;
996-
private enhancedData enhancedDataField;
997-
public enhancedData enhancedData
998-
{
999-
get { return enhancedDataField; }
1000-
set { enhancedDataField = value; enhancedDataIsSet = true; }
1001-
}
1002-
989+
public enhancedData enhancedData;
990+
1003991
private bool processingInstructionsIsSet;
1004992
private processingInstructions processingInstructionsField;
1005993
public processingInstructions processingInstructions
@@ -1058,9 +1046,9 @@ public override string Serialize()
10581046
xml += this.customBillingField.Serialize();
10591047
}
10601048

1061-
if (this.enhancedDataIsSet)
1049+
if (enhancedData != null)
10621050
{
1063-
xml += this.enhancedDataField.Serialize();
1051+
xml += "\r\n<enhancedData>" + enhancedData.Serialize() + "\r\n</enhancedData>";
10641052
}
10651053

10661054
if (this.lodgingInfoIsSet)
@@ -4301,12 +4289,16 @@ public long itemDiscountAmount
43014289
public string productName;
43024290
///end
43034291
public List<detailTax> detailTaxes;
4292+
// 12.33
4293+
public string shipmentId;
4294+
public List<subscriptions> subscription;
43044295

43054296
public lineItemData()
43064297
{
43074298
detailTaxes = new List<detailTax>();
4299+
subscription = new List<subscriptions>();
43084300
}
4309-
4301+
43104302
public string Serialize()
43114303
{
43124304
var xml = "";
@@ -4326,11 +4318,16 @@ public string Serialize()
43264318
if (itemSubCategory != null) xml += "\r\n<itemSubCategory>" + SecurityElement.Escape(itemSubCategory) + "</itemSubCategory>";
43274319
if (productId != null) xml += "\r\n<productId>" + SecurityElement.Escape(productId) + "</productId>";
43284320
if (productName != null) xml += "\r\n<productName>" + SecurityElement.Escape(productName) + "</productName>";
4329-
///end
4321+
///end
43304322
foreach (var detailTax in detailTaxes)
43314323
{
43324324
if (detailTax != null) xml += "\r\n<detailTax>" + detailTax.Serialize() + "</detailTax>";
43334325
}
4326+
if (shipmentId != null) xml += "\r\n<shipmentId>" + SecurityElement.Escape(shipmentId) + "</shipmentId>";
4327+
foreach (var subscription in subscription)
4328+
{
4329+
if (subscription != null) xml += "\r\n<subscription>" + subscription.Serialize() + "</subscription>";
4330+
}
43344331
return xml;
43354332
}
43364333

@@ -6419,6 +6416,87 @@ public string Serialize()
64196416
}
64206417
}
64216418

6419+
//12.33 start
6420+
public partial class subscriptions
6421+
{
6422+
public string subscriptionId;
6423+
public DateTime nextDeliveryDate;
6424+
6425+
private periodUnit periodUnitField;
6426+
private bool periodUnitSet;
6427+
public periodUnit periodUnit
6428+
{
6429+
get { return periodUnitField; }
6430+
set { periodUnitField = value; periodUnitSet = true; }
6431+
}
6432+
6433+
private int numberOfPeriodsField;
6434+
private bool numberOfPeriodsSet;
6435+
public int numberOfPeriods
6436+
{
6437+
get
6438+
{
6439+
return numberOfPeriodsField;
6440+
}
6441+
set
6442+
{
6443+
numberOfPeriodsField = value;
6444+
numberOfPeriodsSet = true;
6445+
}
6446+
}
6447+
6448+
private int regularItemPriceField;
6449+
private bool regularItemPriceSet;
6450+
public int regularItemPrice
6451+
{
6452+
get { return regularItemPriceField; }
6453+
set { regularItemPriceField = value; regularItemPriceSet = true; }
6454+
}
6455+
6456+
private int currentPeriodField;
6457+
private bool currentPeriodSet;
6458+
public int currentPeriod
6459+
{
6460+
get
6461+
{
6462+
return currentPeriodField;
6463+
}
6464+
set
6465+
{
6466+
currentPeriodField = value;
6467+
currentPeriodSet = true;
6468+
}
6469+
}
6470+
6471+
public string Serialize()
6472+
{
6473+
var xml = "";
6474+
if (subscriptionId != null) xml += "\r\n<subscriptionId>" + SecurityElement.Escape(subscriptionId) + "</subscriptionId>";
6475+
if (nextDeliveryDate != null)
6476+
{
6477+
xml += "\r\n<nextDeliveryDate>" + XmlUtil.toXsdDate(nextDeliveryDate) + "</nextDeliveryDate>";
6478+
}
6479+
if (periodUnitSet)
6480+
{
6481+
xml += "\r\n<periodUnit>" + periodUnitField + "</periodUnit>";
6482+
}
6483+
if (numberOfPeriodsSet) xml += "\r\n<numberOfPeriods>" + numberOfPeriodsField + "</numberOfPeriods>";
6484+
if (regularItemPriceSet) xml += "\r\n<regularItemPrice>" + regularItemPriceField + "</regularItemPrice>";
6485+
if (currentPeriodSet) xml += "\r\n<currentPeriod>" + currentPeriodField + "</currentPeriod>";
6486+
return xml;
6487+
}
6488+
}
6489+
6490+
public enum periodUnit
6491+
{
6492+
/// <remarks/>
6493+
WEEK,
6494+
MONTH,
6495+
QUARTER,
6496+
YEAR
6497+
}
6498+
//12.33 end
6499+
64226500
public partial class propertyAddress
64236501
{
64246502
public string name;

CnpSdkForNet/CnpSdkForNetTest/Functional/TestAuth.cs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,5 +1278,63 @@ public void SimpleAuthWithAuthIndicatorWithIncreamentalEnum()
12781278
Assert.AreEqual(checkDate, response.postDate);
12791279
}
12801280
//12.28,12.29 and 12.30 end
1281+
1282+
[Test]
1283+
public void SimpleAuthWithShipmentIdAndSubscription()
1284+
{
1285+
var authorization = new authorization
1286+
{
1287+
id = "1",
1288+
reportGroup = "Planets",
1289+
orderId = "12344",
1290+
amount = 106,
1291+
orderSource = orderSourceType.ecommerce,
1292+
authIndicator = authIndicatorEnum.Estimated,
1293+
card = new cardType
1294+
{
1295+
type = methodOfPaymentTypeEnum.VI,
1296+
number = "414100000000000000",
1297+
expDate = "1210"
1298+
},
1299+
customBilling = new customBilling { phone = "1112223333" },
1300+
enhancedData = new enhancedData
1301+
{
1302+
customerReference = "000000008110801",
1303+
salesTax = 23,
1304+
deliveryType = enhancedDataDeliveryType.DIG,
1305+
taxExempt = false,
1306+
detailTaxes = new List<detailTax>(),
1307+
lineItems = new List<lineItemData>(),
1308+
1309+
}
1310+
};
1311+
1312+
var mysubscription = new subscriptions();
1313+
mysubscription.subscriptionId = "123";
1314+
mysubscription.currentPeriod = 114;
1315+
mysubscription.periodUnit = periodUnit.YEAR;
1316+
mysubscription.numberOfPeriods = 123;
1317+
mysubscription.regularItemPrice = 69;
1318+
mysubscription.nextDeliveryDate = new DateTime(2017, 1, 1);
1319+
1320+
var mylineItemData = new lineItemData();
1321+
mylineItemData.itemSequenceNumber = 1;
1322+
mylineItemData.itemDescription = "Electronics";
1323+
mylineItemData.productCode = "El03";
1324+
mylineItemData.itemCategory = "E Appiances";
1325+
mylineItemData.itemSubCategory = "appliaces";
1326+
mylineItemData.productId = "1023";
1327+
mylineItemData.productName = "dyer";
1328+
mylineItemData.shipmentId = "2124";
1329+
mylineItemData.subscription.Add(mysubscription);
1330+
authorization.enhancedData.lineItems.Add(mylineItemData);
1331+
1332+
var response = _cnp.Authorize(authorization);
1333+
1334+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
1335+
1336+
Assert.AreEqual("000", response.response);
1337+
Assert.AreEqual(checkDate, response.postDate);
1338+
}
12811339
}
12821340
}

0 commit comments

Comments
 (0)