Skip to content

Commit

Permalink
F205651 version12.33 (#35)
Browse files Browse the repository at this point in the history
* committing xsd changes

* commiting code changes

* commiting test changes

* commiting test changes

* commiting test changes
  • Loading branch information
Nitinsl authored Dec 27, 2023
1 parent 52f1cbf commit a2a5e63
Show file tree
Hide file tree
Showing 22 changed files with 11,588 additions and 10,483 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
= Vantiv eCommerce Python SDK

==Version: 12.33.0 (Dec 27, 2023)
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.
* Change: [cnpAPI v12.33] Added new simple types numberOfPeriods of type digit,string10Type
* Change: [cnpAPI v12.33] Added new simple element shipmentId
* Change: [cnpAPI v12.33] new complex element subscription is added with few simple elements subscriptionId ,nextDeliveryDate ,periodUnit ,numberOfPeriods ,regularItemPrice ,currentPeriod
* Change: [cnpAPI v12.33] Added new Enum periodUnit of type enum with values WEEK,MONTH,QUARTER,YEAR
* Change: [cnpAPI v12.32] simple type of customerIpAddress is changed from ipAddress to newly added simpletype stringipAddress

==Version 12.31.0 (July 26, 2023)
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.
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.
Expand Down
17 changes: 17 additions & 0 deletions SchemaCombined_v12.31.xsd → SchemaCombined_v12.33.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@






<xs:complexType name="contact">
Expand Down Expand Up @@ -234,6 +235,8 @@





<xs:element name="lodgingCharge">
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -1166,6 +1169,8 @@
<xs:element name="itemSubCategory" type="xs:string" minOccurs="0"/>
<xs:element name="productId" type="xs:string" minOccurs="0"/>
<xs:element name="productName" type="xs:string" minOccurs="0"/>
<xs:element name="shipmentId" type="xs:string" minOccurs="0"/>
<xs:element ref="xp:subscription" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down Expand Up @@ -3230,6 +3235,18 @@
<xs:element name="tag" type="xs:string" minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
<xs:element name="subscription">
<xs:complexType >
<xs:all>
<xs:element name="subscriptionId" type="xs:string" minOccurs="0"/>
<xs:element name="nextDeliveryDate" type="xs:date" minOccurs="0"/>
<xs:element name="periodUnit" minOccurs="0" type="xs:string" />
<xs:element name="numberOfPeriods" type="xs:integer" minOccurs="0"/>
<xs:element name="regularItemPrice" type="xs:integer" minOccurs="0"/>
<xs:element name="currentPeriod" type="xs:integer" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>



Expand Down
13 changes: 13 additions & 0 deletions docs/source/complextypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ lineItemData
:var productId: String or Number
:var productName: String or Number
:var quantity: String or Number
:var shipmentId: String or Number
:var subscription: instance of :py:class:`vantivsdk.fields.subscription`
:var taxAmount: String or Number
:var unitCost: String or Number
:var unitOfMeasure: String or Number
Expand Down Expand Up @@ -619,6 +621,17 @@ sofortType
:var preferredLanguage: String or Number

subscription
------------
.. py:class:: vantivsdk.fields.subscription
:var currentPeriod: String or Number
:var nextDeliveryDate: String or Number
:var numberOfPeriods: String or Number
:var periodUnit: String or Number
:var regularItemPrice: String or Number
:var subscriptionId: String or Number

token
-----
.. py:class:: vantivsdk.fields.token
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Vantiv eCommerce Python SDK 12.31.0!
Vantiv eCommerce Python SDK 12.33.0!
====================================
.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion schema/cnpBatch_v12.31.xsd → schema/cnpBatch_v12.33.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xp="http://www.vantivcnp.com/schema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:include schemaLocation="cnpTransaction_v12.31.xsd" />
<xs:include schemaLocation="cnpTransaction_v12.33.xsd" />

<xs:element name="cnpRequest">
<xs:complexType>
Expand Down
19 changes: 19 additions & 0 deletions schema/cnpCommon_v12.31.xsd → schema/cnpCommon_v12.33.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="stringipAddress">
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
<xs:pattern value="[A-Z,a-z,0-9, ,:,.]*"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="string150Type">
<xs:restriction base="xs:string">
<xs:maxLength value="150" />
Expand Down Expand Up @@ -979,6 +986,12 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="string10Type">
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="string15Type">
<xs:restriction base="xs:string">
<xs:maxLength value="15" />
Expand Down Expand Up @@ -1028,6 +1041,12 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="numberOfPeriods">
<xs:restriction base="xs:integer">
<xs:totalDigits value="3" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="numberOfPassengersType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:include schemaLocation="cnpTransaction_v12.31.xsd" />
<xs:include schemaLocation="cnpTransaction_v12.33.xsd" />

<xs:complexType name="baseRequest">
<xs:sequence>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:include schemaLocation="cnpCommon_v12.31.xsd" />
<xs:include schemaLocation="cnpCommon_v12.33.xsd" />

<xs:element name="recurringTransaction" type="xp:recurringTransactionType" abstract="true" />
<xs:element name="recurringTransactionResponse" type="xp:recurringTransactionResponseType" abstract="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<xs:schema targetNamespace="http://www.vantivcnp.com/schema" xmlns:xp="http://www.vantivcnp.com/schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:include schemaLocation="cnpCommon_v12.31.xsd"/>
<xs:include schemaLocation="cnpRecurring_v12.31.xsd"/>
<xs:include schemaLocation="cnpCommon_v12.33.xsd"/>
<xs:include schemaLocation="cnpRecurring_v12.33.xsd"/>

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

Expand Down Expand Up @@ -122,7 +122,7 @@
<xs:all>
<xs:element name="authenticationValue" type="xp:authenticationValueType" minOccurs="0"/>
<xs:element name="authenticationTransactionId" type="xp:authenticationTransactionIdType" minOccurs="0"/>
<xs:element name="customerIpAddress" type="xp:ipAddress" minOccurs="0"/>
<xs:element name="customerIpAddress" type="xp:stringipAddress" minOccurs="0"/>
<xs:element name="authenticatedByMerchant" type="xs:boolean" minOccurs="0"/>
<xs:element name="authenticationProtocolVersion" type="xp:authenticationProtocolVersionType" minOccurs="0"/>
<xs:element name="tokenAuthenticationValue" type="xp:tokenAuthenticationValueType" minOccurs="0"/>
Expand Down Expand Up @@ -718,6 +718,8 @@
<xs:element name="itemSubCategory" type="xp:string100Type" minOccurs="0"/>
<xs:element name="productId" type="xp:string150Type" minOccurs="0"/>
<xs:element name="productName" type="xp:string150Type" minOccurs="0"/>
<xs:element name="shipmentId" type="xp:string100Type" minOccurs="0"/>
<xs:element ref="xp:subscription" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down Expand Up @@ -3259,6 +3261,27 @@
<xs:element name="tag" type="xp:string100Type" minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
<xs:element name="subscription">
<xs:complexType >
<xs:all>
<xs:element name="subscriptionId" type="xp:string100Type" minOccurs="0"/>
<xs:element name="nextDeliveryDate" type="xs:date" minOccurs="0"/>
<xs:element name="periodUnit" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="WEEK"/>
<xs:enumeration value="MONTH"/>
<xs:enumeration value="QUARTER"/>
<xs:enumeration value="YEAR"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="numberOfPeriods" type="xp:numberOfPeriods" minOccurs="0"/>
<xs:element name="regularItemPrice" type="xp:transactionAmountType" minOccurs="0"/>
<xs:element name="currentPeriod" type="xp:numberOfPeriods" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>


2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='VantiveCommerceSDK',
version='12.31.0',
version='12.33.0',
description='Vantiv eCommerce Python SDK',
author='Vantiv eCommerce',
author_email='[email protected]',
Expand Down
37 changes: 37 additions & 0 deletions tests/functional/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import os
import sys
import unittest
from calendar import Calendar
from enum import auto

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

def test_simple_auth_with_Subscription_Shipment_Id_StringIpAdd(self):
authorization = fields.authorization()
authorization.id = '1'
authorization.customerId = 'Cust0403'
authorization.reportGroup = 'Default Report Group'
authorization.orderId = '12344401'
authorization.amount = 106
authorization.orderSource = 'ecommerce'
lineItemDataList = list()
lineItemData = fields.lineItemData()
lineItemData.itemDescription = 'des'
lineItemData.itemCategory = 'Chock'
lineItemData.shipmentId = 'prod1234'
sub = fields.subscription()
sub.subscriptionId = '123'
sub.nextDeliveryDate = datetime.datetime.now().strftime("%Y-%m-%d")
sub.periodUnit = 'YEAR'
sub.numberOfPeriods = '748'
sub.regularItemPrice = 148
sub.currentPeriod = '476'
lineItemData.subscription = sub
lineItemDataList.append(lineItemData)
enhancedData = fields.enhancedData()
enhancedData.lineItemData = lineItemDataList
authorization.enhancedData = enhancedData
card = fields.cardType()
card.number = '4457010000000009'
card.expDate = '1210'
card.type = 'VI'
cardholder_authentication = fields.fraudCheckType()
cardholder_authentication.customerIpAddress = '127.0.0.1'
authorization.card = card
authorization.cardholderAuthentication = cardholder_authentication
response = online.request(authorization, conf)
self.assertEqual('000', response['authorizationResponse']['response'])
self.assertEqual('sandbox', response['authorizationResponse']['location'])

if __name__ == '__main__':
unittest.main()
Loading

0 comments on commit a2a5e63

Please sign in to comment.