Skip to content

Instantly share code, notes, and snippets.

@VantivSDK
Created June 7, 2012 16:55
Show Gist options
  • Select an option

  • Save VantivSDK/2890044 to your computer and use it in GitHub Desktop.

Select an option

Save VantivSDK/2890044 to your computer and use it in GitHub Desktop.
Python SDK- Litle Sale Transaction
from litleSdkPython.litleOnlineRequest import *
config = Configuration()
config.setUser("User")
config.setPassword("Pass")
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="John Smith"
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 "Response: " + response.response
print "Message: " + response.message
print "LitleTransaction ID: " + str(response.litleTxnId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment