Skip to content

Commit a2a5e63

Browse files
authored
F205651 version12.33 (#35)
* committing xsd changes * commiting code changes * commiting test changes * commiting test changes * commiting test changes
1 parent 52f1cbf commit a2a5e63

22 files changed

+11588
-10483
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
= Vantiv eCommerce Python SDK
22

3+
==Version: 12.33.0 (Dec 27, 2023)
4+
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.
5+
* Change: [cnpAPI v12.33] Added new simple types numberOfPeriods of type digit,string10Type
6+
* Change: [cnpAPI v12.33] Added new simple element shipmentId
7+
* Change: [cnpAPI v12.33] new complex element subscription is added with few simple elements subscriptionId ,nextDeliveryDate ,periodUnit ,numberOfPeriods ,regularItemPrice ,currentPeriod
8+
* Change: [cnpAPI v12.33] Added new Enum periodUnit of type enum with values WEEK,MONTH,QUARTER,YEAR
9+
* Change: [cnpAPI v12.32] simple type of customerIpAddress is changed from ipAddress to newly added simpletype stringipAddress
10+
311
==Version 12.31.0 (July 26, 2023)
412
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.
513
This SDK supports Python3 version 3.8 and later.In case you are using earlier Python version, Please upgrade to Python 3.8 or later to use feature supported by cnpAPI v12.31.

SchemaCombined_v12.31.xsd renamed to SchemaCombined_v12.33.xsd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666

6767

6868

69+
6970

7071

7172
<xs:complexType name="contact">
@@ -234,6 +235,8 @@
234235

235236

236237

238+
239+
237240
<xs:element name="lodgingCharge">
238241
<xs:complexType>
239242
<xs:sequence>
@@ -1166,6 +1169,8 @@
11661169
<xs:element name="itemSubCategory" type="xs:string" minOccurs="0"/>
11671170
<xs:element name="productId" type="xs:string" minOccurs="0"/>
11681171
<xs:element name="productName" type="xs:string" minOccurs="0"/>
1172+
<xs:element name="shipmentId" type="xs:string" minOccurs="0"/>
1173+
<xs:element ref="xp:subscription" minOccurs="0" maxOccurs="1"/>
11691174
</xs:sequence>
11701175
</xs:complexType>
11711176
</xs:element>
@@ -3230,6 +3235,18 @@
32303235
<xs:element name="tag" type="xs:string" minOccurs="0" maxOccurs="5"/>
32313236
</xs:sequence>
32323237
</xs:complexType>
3238+
<xs:element name="subscription">
3239+
<xs:complexType >
3240+
<xs:all>
3241+
<xs:element name="subscriptionId" type="xs:string" minOccurs="0"/>
3242+
<xs:element name="nextDeliveryDate" type="xs:date" minOccurs="0"/>
3243+
<xs:element name="periodUnit" minOccurs="0" type="xs:string" />
3244+
<xs:element name="numberOfPeriods" type="xs:integer" minOccurs="0"/>
3245+
<xs:element name="regularItemPrice" type="xs:integer" minOccurs="0"/>
3246+
<xs:element name="currentPeriod" type="xs:integer" minOccurs="0" />
3247+
</xs:all>
3248+
</xs:complexType>
3249+
</xs:element>
32333250

32343251

32353252

docs/source/complextypes.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ lineItemData
373373
:var productId: String or Number
374374
:var productName: String or Number
375375
:var quantity: String or Number
376+
:var shipmentId: String or Number
377+
:var subscription: instance of :py:class:`vantivsdk.fields.subscription`
376378
:var taxAmount: String or Number
377379
:var unitCost: String or Number
378380
:var unitOfMeasure: String or Number
@@ -619,6 +621,17 @@ sofortType
619621
620622
:var preferredLanguage: String or Number
621623

624+
subscription
625+
------------
626+
.. py:class:: vantivsdk.fields.subscription
627+
628+
:var currentPeriod: String or Number
629+
:var nextDeliveryDate: String or Number
630+
:var numberOfPeriods: String or Number
631+
:var periodUnit: String or Number
632+
:var regularItemPrice: String or Number
633+
:var subscriptionId: String or Number
634+
622635
token
623636
-----
624637
.. py:class:: vantivsdk.fields.token

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Vantiv eCommerce Python SDK 12.31.0!
1+
Vantiv eCommerce Python SDK 12.33.0!
22
====================================
33
.. toctree::
44
:maxdepth: 2

schema/cnpBatch_v12.31.xsd renamed to schema/cnpBatch_v12.33.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
33
xmlns:xp="http://www.vantivcnp.com/schema" elementFormDefault="qualified" attributeFormDefault="unqualified">
44

5-
<xs:include schemaLocation="cnpTransaction_v12.31.xsd" />
5+
<xs:include schemaLocation="cnpTransaction_v12.33.xsd" />
66

77
<xs:element name="cnpRequest">
88
<xs:complexType>

schema/cnpCommon_v12.31.xsd renamed to schema/cnpCommon_v12.33.xsd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@
151151
</xs:restriction>
152152
</xs:simpleType>
153153

154+
<xs:simpleType name="stringipAddress">
155+
<xs:restriction base="xs:string">
156+
<xs:maxLength value="100" />
157+
<xs:pattern value="[A-Z,a-z,0-9, ,:,.]*"/>
158+
</xs:restriction>
159+
</xs:simpleType>
160+
154161
<xs:simpleType name="string150Type">
155162
<xs:restriction base="xs:string">
156163
<xs:maxLength value="150" />
@@ -979,6 +986,12 @@
979986
</xs:restriction>
980987
</xs:simpleType>
981988

989+
<xs:simpleType name="string10Type">
990+
<xs:restriction base="xs:string">
991+
<xs:maxLength value="10" />
992+
</xs:restriction>
993+
</xs:simpleType>
994+
982995
<xs:simpleType name="string15Type">
983996
<xs:restriction base="xs:string">
984997
<xs:maxLength value="15" />
@@ -1028,6 +1041,12 @@
10281041
</xs:restriction>
10291042
</xs:simpleType>
10301043

1044+
<xs:simpleType name="numberOfPeriods">
1045+
<xs:restriction base="xs:integer">
1046+
<xs:totalDigits value="3" />
1047+
</xs:restriction>
1048+
</xs:simpleType>
1049+
10311050
<xs:simpleType name="numberOfPassengersType">
10321051
<xs:restriction base="xs:integer">
10331052
<xs:minInclusive value="0" />

schema/cnpOnline_v12.31.xsd renamed to schema/cnpOnline_v12.33.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
44
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
55

6-
<xs:include schemaLocation="cnpTransaction_v12.31.xsd" />
6+
<xs:include schemaLocation="cnpTransaction_v12.33.xsd" />
77

88
<xs:complexType name="baseRequest">
99
<xs:sequence>

schema/cnpRecurring_v12.31.xsd renamed to schema/cnpRecurring_v12.33.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
22
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
33

4-
<xs:include schemaLocation="cnpCommon_v12.31.xsd" />
4+
<xs:include schemaLocation="cnpCommon_v12.33.xsd" />
55

66
<xs:element name="recurringTransaction" type="xp:recurringTransactionType" abstract="true" />
77
<xs:element name="recurringTransactionResponse" type="xp:recurringTransactionResponseType" abstract="true" />

schema/cnpTransaction_v12.31.xsd renamed to schema/cnpTransaction_v12.33.xsd

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
22
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
33

4-
<xs:include schemaLocation="cnpCommon_v12.31.xsd"/>
5-
<xs:include schemaLocation="cnpRecurring_v12.31.xsd"/>
4+
<xs:include schemaLocation="cnpCommon_v12.33.xsd"/>
5+
<xs:include schemaLocation="cnpRecurring_v12.33.xsd"/>
66

77
<xs:element name="transaction" type="xp:transactionType" abstract="true"/>
88

@@ -122,7 +122,7 @@
122122
<xs:all>
123123
<xs:element name="authenticationValue" type="xp:authenticationValueType" minOccurs="0"/>
124124
<xs:element name="authenticationTransactionId" type="xp:authenticationTransactionIdType" minOccurs="0"/>
125-
<xs:element name="customerIpAddress" type="xp:ipAddress" minOccurs="0"/>
125+
<xs:element name="customerIpAddress" type="xp:stringipAddress" minOccurs="0"/>
126126
<xs:element name="authenticatedByMerchant" type="xs:boolean" minOccurs="0"/>
127127
<xs:element name="authenticationProtocolVersion" type="xp:authenticationProtocolVersionType" minOccurs="0"/>
128128
<xs:element name="tokenAuthenticationValue" type="xp:tokenAuthenticationValueType" minOccurs="0"/>
@@ -718,6 +718,8 @@
718718
<xs:element name="itemSubCategory" type="xp:string100Type" minOccurs="0"/>
719719
<xs:element name="productId" type="xp:string150Type" minOccurs="0"/>
720720
<xs:element name="productName" type="xp:string150Type" minOccurs="0"/>
721+
<xs:element name="shipmentId" type="xp:string100Type" minOccurs="0"/>
722+
<xs:element ref="xp:subscription" minOccurs="0" maxOccurs="1"/>
721723
</xs:sequence>
722724
</xs:complexType>
723725
</xs:element>
@@ -3259,6 +3261,27 @@
32593261
<xs:element name="tag" type="xp:string100Type" minOccurs="0" maxOccurs="5"/>
32603262
</xs:sequence>
32613263
</xs:complexType>
3264+
<xs:element name="subscription">
3265+
<xs:complexType >
3266+
<xs:all>
3267+
<xs:element name="subscriptionId" type="xp:string100Type" minOccurs="0"/>
3268+
<xs:element name="nextDeliveryDate" type="xs:date" minOccurs="0"/>
3269+
<xs:element name="periodUnit" minOccurs="0">
3270+
<xs:simpleType>
3271+
<xs:restriction base="xs:string">
3272+
<xs:enumeration value="WEEK"/>
3273+
<xs:enumeration value="MONTH"/>
3274+
<xs:enumeration value="QUARTER"/>
3275+
<xs:enumeration value="YEAR"/>
3276+
</xs:restriction>
3277+
</xs:simpleType>
3278+
</xs:element>
3279+
<xs:element name="numberOfPeriods" type="xp:numberOfPeriods" minOccurs="0"/>
3280+
<xs:element name="regularItemPrice" type="xp:transactionAmountType" minOccurs="0"/>
3281+
<xs:element name="currentPeriod" type="xp:numberOfPeriods" minOccurs="0" />
3282+
</xs:all>
3283+
</xs:complexType>
3284+
</xs:element>
32623285
</xs:schema>
32633286

32643287

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name='VantiveCommerceSDK',
14-
version='12.31.0',
14+
version='12.33.0',
1515
description='Vantiv eCommerce Python SDK',
1616
author='Vantiv eCommerce',
1717
author_email='SDKSupport@vantiv.com',

tests/functional/test_auth.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import os
2626
import sys
2727
import unittest
28+
from calendar import Calendar
2829
from enum import auto
2930

3031
package_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
@@ -823,6 +824,42 @@ def test_simple_auth_with_orderChanneEnumMIT_sellerInfo_authIndicatorEstimated(s
823824
self.assertEquals('000', response['authorizationResponse']['response'])
824825
self.assertEquals('sandbox', response['authorizationResponse']['location'])
825826

827+
def test_simple_auth_with_Subscription_Shipment_Id_StringIpAdd(self):
828+
authorization = fields.authorization()
829+
authorization.id = '1'
830+
authorization.customerId = 'Cust0403'
831+
authorization.reportGroup = 'Default Report Group'
832+
authorization.orderId = '12344401'
833+
authorization.amount = 106
834+
authorization.orderSource = 'ecommerce'
835+
lineItemDataList = list()
836+
lineItemData = fields.lineItemData()
837+
lineItemData.itemDescription = 'des'
838+
lineItemData.itemCategory = 'Chock'
839+
lineItemData.shipmentId = 'prod1234'
840+
sub = fields.subscription()
841+
sub.subscriptionId = '123'
842+
sub.nextDeliveryDate = datetime.datetime.now().strftime("%Y-%m-%d")
843+
sub.periodUnit = 'YEAR'
844+
sub.numberOfPeriods = '748'
845+
sub.regularItemPrice = 148
846+
sub.currentPeriod = '476'
847+
lineItemData.subscription = sub
848+
lineItemDataList.append(lineItemData)
849+
enhancedData = fields.enhancedData()
850+
enhancedData.lineItemData = lineItemDataList
851+
authorization.enhancedData = enhancedData
852+
card = fields.cardType()
853+
card.number = '4457010000000009'
854+
card.expDate = '1210'
855+
card.type = 'VI'
856+
cardholder_authentication = fields.fraudCheckType()
857+
cardholder_authentication.customerIpAddress = '127.0.0.1'
858+
authorization.card = card
859+
authorization.cardholderAuthentication = cardholder_authentication
860+
response = online.request(authorization, conf)
861+
self.assertEqual('000', response['authorizationResponse']['response'])
862+
self.assertEqual('sandbox', response['authorizationResponse']['location'])
826863

827864
if __name__ == '__main__':
828865
unittest.main()

0 commit comments

Comments
 (0)