<commit_before>litle-sdk-for-python
====================

About Litle
------------
[Litle &amp; Co.](http://www.litle.com) powers the payment processing engines for leading companies that sell directly to consumers through  internet retail, direct response marketing (TV, radio and telephone), and online services. Litle & Co. is the leading, independent authority in card-not-present (CNP) commerce, transaction processing and merchant services.


About this SDK
--------------
The Litle Python SDK is a Python implementation of the [Litle &amp; Co.](http://www.litle.com). XML API. This SDK was created to make it as easy as possible to connect process your payments with Litle.  This SDK utilizes  the HTTPS protocol to securely connect to Litle.  Using the SDK requires coordination with the Litle team in order to be provided with credentials for accessing our systems.

Our Python supports all of the functionality present in Litle XML v8. Please see the online copy of our XSD for Litle XML to get more details on what is supported by the Litle payments engine.

This SDK is implemented to support the Python programming language and was created by Litle & Co. It is intended use is for online transactions processing utilizing your account on the Litle payments engine.

See LICENSE file for details on using this software.

Source Code available from : https://github.com/LitleCo/litle-sdk-for-Python

Please contact [Litle &amp; Co.](http://www.litle.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way.  We are reachable at <EMAIL>

SDK Python Dependencies
----------------------
pyxb

re

Setup
-----

1) Install the LitleOnline Python SDK from it.

>git clone git://github.com/LitleCo/litle_sdk_for_python.git

2) Add the LitleSdkPython and LitleSdkPythonTest libraies to your Project References

3) Once the SDK is downloaded run our setUpTest.py script

4) Run LitleSdkPythonTest.all.test_all.py

5) Create a python file similar to:

```python
from litleSdkPython.litleOnlineRequest import *

config = Configuration()
config.setUser("User")
config.setPassword("<PASSWORD>")
config.setMerchantId("123")
config.setUrl("Sandbox")
config.setProxy("")

#sale
sale = litleXmlFields.sale()
sale.orderId = '1'
sale.amount = 10010
sale.orderSource = 'ecommerce'
contact = litleXmlFields.contact();
contact.name="<NAME>"
contact.addressLine1="1 Main St."
contact.city="Burlington"
contact.state="MA"
contact.zip="01803-3747"
contact.country="USA"
sale.billToAddress = contact
card = litleXmlFields.cardType()
card.number = "4457010000000009"
card.expDate = "0112"
card.cardValidationNum = "349"
card.type = 'VI'
sale.card = card

litleXml = litleOnlineRequest(config)
response = litleXml.sendRequest(sale)

#display results
print "Message: " + response.message
print "LitleTransaction ID: " + str(response.transactionResponse.litleTxnId)
```
NOTE: you may need to edit the proxy to to work for your system

6) Next run this file.  You should see the following result provided you have connectivity to the Litle certification environment.  You will see an HTTP error if you don't have access to the Litle URL.

    Message: Valid Format
    Litle Transaction ID: <your-numeric-litle-txn-id>
    
Please contact Litle & Co. with any further questions.   You can reach us at <EMAIL>
<commit_msg>a few fixes<commit_after>litle-sdk-for-python
====================

About Litle
------------
[Litle &amp; Co.](http://www.litle.com) powers the payment processing engines for leading companies that sell directly to consumers through  internet retail, direct response marketing (TV, radio and telephone), and online services. Litle & Co. is the leading, independent authority in card-not-present (CNP) commerce, transaction processing and merchant services.


About this SDK
--------------
The Litle Python SDK is a Python implementation of the [Litle &amp; Co.](http://www.litle.com). XML API. This SDK was created to make it as easy as possible to connect process your payments with Litle.  This SDK utilizes  the HTTPS protocol to securely connect to Litle.  Using the SDK requires coordination with the Litle team in order to be provided with credentials for accessing our systems.

Our Python supports all of the functionality present in Litle XML v8. Please see the online copy of our XSD for Litle XML to get more details on what is supported by the Litle payments engine.

This SDK is implemented to support the Python programming language and was created by Litle & Co. It is intended use is for online transactions processing utilizing your account on the Litle payments engine.

See LICENSE file for details on using this software.

Source Code available from : https://github.com/LitleCo/litle-sdk-for-Python

Please contact [Litle &amp; Co.](http://www.litle.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way.  We are reachable at <EMAIL>

SDK Python Dependencies
----------------------
pyxb

mock

Setup
-----

1) Install the LitleOnline Python SDK from it.

>git clone git://github.com/LitleCo/litle_sdk_for_python.git

2) Add the LitleSdkPython and LitleSdkPythonTest libraies to your Project References

3) Once the SDK is downloaded run our setUpTest.py

4) Run LitleSdkPythonTest.all.test_all.py

5) Create a python file similar to:

```python
from litleSdkPython.litleOnlineRequest import *

config = Configuration()
config.setUser("User")
config.setPassword("<PASSWORD>")
config.setMerchantId("123")
config.setUrl("Sandbox")
config.setProxy("")

#sale
sale = litleXmlFields.sale()
sale.orderId = '1'
sale.amount = 10010
sale.orderSource = 'ecommerce'
contact = litleXmlFields.contact();
contact.name="<NAME>"
contact.addressLine1="1 Main St."
contact.city="Burlington"
contact.state="MA"
contact.zip="01803-3747"
contact.country="USA"
sale.billToAddress = contact
card = litleXmlFields.cardType()
card.number = "4457010000000009"
card.expDate = "0112"
card.cardValidationNum = "349"
card.type = 'VI'
sale.card = card

litleXml = litleOnlineRequest(config)
response = litleXml.sendRequest(sale)

#display results
print "Message: " + response.message
print "LitleTransaction ID: " + str(response.transactionResponse.litleTxnId)
```
NOTE: you may need to edit the proxy to to work for your system

6) Next run this file.  You should see the following result provided you have connectivity to the Litle certification environment.  You will see an HTTP error if you don't have access to the Litle URL.

    Message: Valid Format
    Litle Transaction ID: <your-numeric-litle-txn-id>
    
Please contact Litle & Co. with any further questions.   You can reach us at <EMAIL>

{'fraction_non_alphanumeric': 0.09614525971126656, 'fraction_numerical': 0.01488316713796696, 'mean_word_length': 4.384615384615385, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2668116', 'n_tokens_mistral': 1985, 'n_tokens_neox': 1841, 'n_words': 805}