Skip to content

Commit e514c75

Browse files
authored
Merge pull request #40 from d685shvarts/12.17
12.17
2 parents c98e6f8 + 027cab9 commit e514c75

File tree

13 files changed

+241
-6
lines changed

13 files changed

+241
-6
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,8 @@ ASALocalRun/
313313
*.nvuser
314314

315315
# MFractors (Xamarin productivity tool) working folder
316-
.mfractor/
316+
.mfractor/
317+
318+
#DS_Store from MACOS
319+
.DS_Store
320+
CnpSdkForNet/.DS_Store

CHANGELOG

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

22
= Worldpay CNP CHANGELOG
33

4+
==Version 12.17.0 (October 21, 2020)
5+
* Feature: Added businessIndicator in authorization, forceCapture, captureGivenAuth, sale, credit
6+
* Feature: Added businessApplicationIdentifier
7+
48

59
==Version 12.16.0 (October 14, 2020)
610
* Feature: Added new transaction type: transactionReversal

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.16.0</PackageVersion>
6+
<PackageVersion>12.17.0</PackageVersion>
77
<Title>Vantiv.CnpSdkForNet</Title>
88
<Authors>Worldpay</Authors>
99
<Copyright>Copyright © Worldpay 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.16";
12-
public const String CurrentCNPSDKVersion = "12.16.0";
11+
public const String CurrentCNPXMLVersion = "12.17";
12+
public const String CurrentCNPSDKVersion = "12.17.0";
1313
}
1414
}

CnpSdkForNet/CnpSdkForNet/XmlRequestFields.cs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,18 @@ public govtTaxTypeEnum taxType
299299
get { return taxTypeField; }
300300
set { taxTypeField = value; taxTypeSet = true; }
301301
}
302+
303+
304+
private businessIndicatorEnum businessIndicatorField;
305+
private bool businessIndicatorSet;
306+
public businessIndicatorEnum businessIndicator
307+
{
308+
get { return businessIndicatorField; }
309+
set { businessIndicatorField = value; businessIndicatorSet = true; }
310+
}
311+
312+
313+
302314
private processingType processingTypeField;
303315
private bool processingTypeSet;
304316
public processingType processingType
@@ -467,10 +479,12 @@ public override string Serialize()
467479
{
468480
xml += "\r\n<customBilling>" + customBilling.Serialize() + "\r\n</customBilling>";
469481
}
482+
470483
if (taxTypeSet)
471484
{
472485
xml += "\r\n<taxType>" + taxTypeField + "</taxType>";
473486
}
487+
474488
if (enhancedData != null)
475489
{
476490
xml += "\r\n<enhancedData>" + enhancedData.Serialize() + "\r\n</enhancedData>";
@@ -537,6 +551,12 @@ public override string Serialize()
537551
{
538552
xml += "\r\n<merchantCategoryCode>" + merchantCategoryCode + "</merchantCategoryCode>";
539553
}
554+
555+
556+
if (businessIndicatorSet)
557+
{
558+
xml += "\r\n<businessIndicator>" + businessIndicatorField + "</businessIndicator>";
559+
}
540560
}
541561

542562
xml += "\r\n</authorization>";
@@ -862,6 +882,18 @@ public govtTaxTypeEnum taxType
862882
get { return taxTypeField; }
863883
set { taxTypeField = value; taxTypeSet = true; }
864884
}
885+
886+
887+
private businessIndicatorEnum businessIndicatorField;
888+
private bool businessIndicatorSet;
889+
public businessIndicatorEnum businessIndicator
890+
{
891+
get { return businessIndicatorField; }
892+
set { businessIndicatorField = value; businessIndicatorSet = true; }
893+
}
894+
895+
896+
865897
public billMeLaterRequest billMeLaterRequest;
866898
public enhancedData enhancedData;
867899
public lodgingInfo lodgingInfo;
@@ -968,6 +1000,7 @@ public override string Serialize()
9681000
{
9691001
xml += "\r\n<taxType>" + taxTypeField + "</taxType>";
9701002
}
1003+
9711004
if (billMeLaterRequest != null)
9721005
{
9731006
xml += "\r\n<billMeLaterRequest>" + billMeLaterRequest.Serialize() + "\r\n</billMeLaterRequest>";
@@ -1016,6 +1049,10 @@ public override string Serialize()
10161049
{
10171050
xml += "\r\n<merchantCategoryCode>" + merchantCategoryCode + "</merchantCategoryCode>";
10181051
}
1052+
if (businessIndicatorSet)
1053+
{
1054+
xml += "\r\n<businessIndicator>" + businessIndicatorField + "</businessIndicator>";
1055+
}
10191056
xml += "\r\n</captureGivenAuth>";
10201057
return xml;
10211058
}
@@ -1137,6 +1174,17 @@ public taxTypeIdentifierEnum taxType
11371174
get { return taxTypeField; }
11381175
set { taxTypeField = value; taxTypeSet = true; }
11391176
}
1177+
1178+
private businessIndicatorEnum businessIndicatorField;
1179+
private bool businessIndicatorSet;
1180+
public businessIndicatorEnum businessIndicator
1181+
{
1182+
get { return businessIndicatorField; }
1183+
set { businessIndicatorField = value; businessIndicatorSet = true; }
1184+
}
1185+
1186+
1187+
11401188
public billMeLaterRequest billMeLaterRequest;
11411189
public pos pos;
11421190
private string pinField;
@@ -1211,6 +1259,8 @@ public override string Serialize()
12111259
}
12121260
if (payPalNotes != null) xml += "\r\n<payPalNotes>" + SecurityElement.Escape(payPalNotes) + "</payPalNotes>";
12131261
if (actionReason != null) xml += "\r\n<actionReason>" + SecurityElement.Escape(actionReason) + "</actionReason>";
1262+
if (businessIndicatorSet) xml += "\r\n<businessIndicator>" + businessIndicatorField + "</businessIndicator>";
1263+
12141264
xml += "\r\n</credit>";
12151265
return xml;
12161266
}
@@ -1618,6 +1668,18 @@ public govtTaxTypeEnum taxType
16181668
get { return taxTypeField; }
16191669
set { taxTypeField = value; taxTypeSet = true; }
16201670
}
1671+
1672+
private businessIndicatorEnum businessIndicatorField;
1673+
private bool businessIndicatorSet;
1674+
public businessIndicatorEnum businessIndicator
1675+
{
1676+
get { return businessIndicatorField; }
1677+
set { businessIndicatorField = value; businessIndicatorSet = true; }
1678+
}
1679+
1680+
1681+
1682+
16211683
public enhancedData enhancedData;
16221684
public lodgingInfo lodgingInfo;
16231685
public processingInstructions processingInstructions;
@@ -1727,6 +1789,11 @@ public override string Serialize()
17271789
{
17281790
xml += "\r\n<merchantCategoryCode>" + merchantCategoryCode + "</merchantCategoryCode>";
17291791
}
1792+
1793+
if (businessIndicatorSet)
1794+
{
1795+
xml += "\r\n<businessIndicator>" + businessIndicatorField + "</businessIndicator>";
1796+
}
17301797

17311798
xml += "\r\n</forceCapture>";
17321799
return xml;
@@ -2169,6 +2236,17 @@ public govtTaxTypeEnum taxType
21692236
get { return taxTypeField; }
21702237
set { taxTypeField = value; taxTypeSet = true; }
21712238
}
2239+
2240+
private businessIndicatorEnum businessIndicatorField;
2241+
private bool businessIndicatorSet;
2242+
public businessIndicatorEnum businessIndicator
2243+
{
2244+
get { return businessIndicatorField; }
2245+
set { businessIndicatorField = value; businessIndicatorSet = true; }
2246+
}
2247+
2248+
2249+
21722250
public enhancedData enhancedData;
21732251
public processingInstructions processingInstructions;
21742252
public pos pos;
@@ -2447,6 +2525,10 @@ public override string Serialize()
24472525
{
24482526
xml += "\r\n<merchantCategoryCode>" + merchantCategoryCode + "</merchantCategoryCode>";
24492527
}
2528+
if (businessIndicatorSet)
2529+
{
2530+
xml += "\r\n<businessIndicator>" + businessIndicatorField + "</businessIndicator>";
2531+
}
24502532

24512533
//if (routingPreferenceSet)
24522534
//{

CnpSdkForNet/CnpSdkForNet/XmlResponseFields.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@ public enum govtTaxTypeEnum
381381
/// <remarks/>
382382
fee,
383383
}
384+
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
385+
[System.SerializableAttribute()]
386+
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.vantivcnp.com/schema")]
387+
public enum businessIndicatorEnum
388+
{
389+
/// <remarks/>
390+
consumerBillPayment,
391+
}
384392

385393
/// <remarks/>
386394
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
@@ -2977,6 +2985,17 @@ public enum affluenceTypeEnum
29772985
[System.Xml.Serialization.XmlEnumAttribute("MASS AFFLUENT")]
29782986
MASSAFFLUENT,
29792987
}
2988+
2989+
/// <remarks/>
2990+
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
2991+
[System.SerializableAttribute()]
2992+
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.vantivcnp.com/schema")]
2993+
public enum businessApplicationIdentifierEnum
2994+
{
2995+
2996+
/// <remarks/>
2997+
CB,
2998+
}
29802999

29813000
/// <remarks/>
29823001
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]

CnpSdkForNet/CnpSdkForNetTest/Functional/TestAuth.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,5 +811,32 @@ public void SimpleAuthWithLocation()
811811
Assert.AreEqual(checkDate, response.postDate);
812812
Assert.AreEqual("sandbox", response.location);
813813
}
814+
815+
[Test]
816+
public void SimpleAuthWithBusinessIndicator()
817+
{
818+
var authorization = new authorization
819+
{
820+
id = "1",
821+
reportGroup = "Planets",
822+
orderId = "12344",
823+
amount = 106,
824+
orderSource = orderSourceType.ecommerce,
825+
businessIndicator = businessIndicatorEnum.consumerBillPayment,
826+
card = new cardType
827+
{
828+
type = methodOfPaymentTypeEnum.VI,
829+
number = "414100000000000000",
830+
expDate = "1210"
831+
},
832+
customBilling = new customBilling { phone = "1112223333" }
833+
};
834+
var response = _cnp.Authorize(authorization);
835+
836+
DateTime checkDate = new DateTime(0001, 1, 1, 00, 00, 00);
837+
838+
Assert.AreEqual("000", response.response);
839+
Assert.AreEqual(checkDate, response.postDate);
840+
}
814841
}
815842
}

CnpSdkForNet/CnpSdkForNetTest/Functional/TestCaptureGivenAuth.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,36 @@ public void SimpleCaptureGivenAuthWithCardWithLocation()
306306
Assert.AreEqual("sandbox", response.location);
307307
Assert.AreEqual("Approved", response.message);
308308
}
309+
310+
[Test]
311+
public void SimpleCaptureGivenAuthWithBusinessIndicator()
312+
{
313+
var capturegivenauth = new captureGivenAuth
314+
{
315+
id = "1",
316+
amount = 106,
317+
orderId = "12344",
318+
authInformation = new authInformation
319+
{
320+
authDate = new DateTime(2002, 10, 9),
321+
authCode = "543216",
322+
authAmount = 12345,
323+
},
324+
orderSource = orderSourceType.ecommerce,
325+
card = new cardType
326+
{
327+
type = methodOfPaymentTypeEnum.VI,
328+
number = "4100000000000000",
329+
expDate = "1210",
330+
},
331+
processingType = processingType.accountFunding,
332+
businessIndicator = businessIndicatorEnum.consumerBillPayment,
333+
originalNetworkTransactionId = "abc123",
334+
originalTransactionAmount = 123456789
335+
};
336+
337+
var response = _cnp.CaptureGivenAuth(capturegivenauth);
338+
Assert.AreEqual("Approved", response.message);
339+
}
309340
}
310341
}

CnpSdkForNet/CnpSdkForNetTest/Functional/TestCredit.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,27 @@ public void TestCreditWithCardAsync_newMerchantId()
237237
var response = _cnp.CreditAsync(creditObj, cancellationToken);
238238
Assert.AreEqual("000", response.Result.response);
239239
}
240+
[Test]
241+
public void SimpleCreditWithBusinessIndicator()
242+
{
243+
var creditObj = new credit
244+
{
245+
id = "1",
246+
reportGroup = "planets",
247+
amount = 106,
248+
orderId = "2111",
249+
orderSource = orderSourceType.ecommerce,
250+
businessIndicator = businessIndicatorEnum.consumerBillPayment,
251+
card = new cardType
252+
{
253+
type = methodOfPaymentTypeEnum.VI,
254+
number = "4100000000000001",
255+
expDate = "1210"
256+
}
257+
};
240258

259+
var response = _cnp.Credit(creditObj);
260+
Assert.AreEqual("Approved", response.message);
261+
}
241262
}
242263
}

CnpSdkForNet/CnpSdkForNetTest/Functional/TestForceCapture.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,30 @@ public void TestForceCaptureWithCardAsync()
172172
var response = _cnp.ForceCaptureAsync(forcecapture, cancellationToken);
173173
Assert.AreEqual("000", response.Result.response);
174174
}
175+
[Test]
176+
public void SimpleForceCaptureBusinessIndicator()
177+
{
178+
var forcecapture = new forceCapture
179+
{
180+
id = "1",
181+
amount = 106,
182+
orderId = "12344",
183+
orderSource = orderSourceType.ecommerce,
184+
processingType = processingType.accountFunding,
185+
businessIndicator = businessIndicatorEnum.consumerBillPayment,
186+
card = new cardType
187+
{
188+
type = methodOfPaymentTypeEnum.VI,
189+
number = "4100000000000001",
190+
expDate = "1210"
191+
},
192+
merchantCategoryCode = "1111"
193+
};
194+
195+
196+
var response = _cnp.ForceCapture(forcecapture);
197+
Assert.AreEqual("Approved", response.message);
198+
}
175199

176200
}
177201
}

0 commit comments

Comments
 (0)