Esempio n. 1
0
import time
import mpgClasses

host = "esqa.moneris.com"
store_id = "store5"
api_token = "yesguy"

data_key = "I697jeffVXSW2xJp8ixCrIG84"

updateCC = mpgClasses.ResUpdateCC(data_key)

avs_street_number = "123"
avs_street_name = "Main St"
avs_zipcode = "a1a2b2"

avs = mpgClasses.AvsInfo(avs_street_number, avs_street_name, avs_zipcode)

email = "*****@*****.**"
phone = "8889876543"
note = "Test"
pan = "5454545454545454"
expdate = "1711"
cryptType = "1"
custId = "cust 2"
updateCC.setCustId(custId)
updateCC.setAvsInfo(avs)
updateCC.setEmail(email)
updateCC.setPhone(phone)
updateCC.setNote(note)
updateCC.setPan(pan)
updateCC.setExpdate(expdate)
import time
import time
import mpgClasses

p = mpgClasses.Purchase ("test_python-" + str(time.time()), "1.00", "4242424242424242", "0909", "7")
p.setCustId ("cust 1")
cvd = mpgClasses.CvdInfo("1", "123")
avs = mpgClasses.AvsInfo("123", "Main St", "a1a2b2")

cust = mpgClasses.CustInfo()
billing = mpgClasses.BillingInfo("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost")
shipping = mpgClasses.ShippingInfo("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost")
email = "*****@*****.**"
instruction = "take it slow"
cust.setBilling(billing)
cust.setShipping(shipping)
cust.setEmail(email)
cust.setInstruction(instruction)
cust.addItem(mpgClasses.Item("item 123", "1", "4527182-90123", "5.00"))
cust.addItem(mpgClasses.Item("item 234", "2", "4527182-90234", "4.00"))
cust.addItem(mpgClasses.Item("item 345", "3", "4527182-90345", "3.00"))
p.setCustInfo (cust)

p.setCvdInfo(cvd)
p.setAvsInfo(avs)

req = mpgClasses.mpgHttpsPost("esqa.moneris.com", "store3", "yesguy", p)
req.postRequest()
resp = req.getResponse()
print ("ReceiptId: " + resp.getReceiptId()) 
print ("ReferenceNum: " + resp.getReferenceNum()) 
import time
import mpgClasses

p = mpgClasses.ResPreauthCC ("hZkvivLQzRR5iI7knfUEkOEWb", "test_python-" + str(time.time()), "1.00", "7")
p.setCustId ("cust 1")
cvd = mpgClasses.CvdInfo("1", "123")
avs = mpgClasses.AvsInfo("1234", "Eglinton Ave E BNS Transit 91538", "a1a2b2")

p.setCvdInfo(cvd)
p.setAvsInfo(avs)

req = mpgClasses.mpgHttpsPost("esqa.moneris.com", "store5", "yesguy", p)
req.postRequest()
resp = req.getResponse()
print ("ReceiptId: " + resp.getReceiptId()) 
print ("ReferenceNum: " + resp.getReferenceNum()) 
print ("ResponseCode: " + resp.getResponseCode()) 
print ("ISO: " + resp.getISO()) 
print ("AuthCode: " + resp.getAuthCode()) 
print ("TransTime: " + resp.getTransTime()) 
print ("TransDate: " + resp.getTransDate()) 
print ("TransType: " + resp.getTransType()) 
print ("Complete: " + resp.getComplete()) 
print ("Message: " + resp.getMessage()) 
print ("TransAmount: " + resp.getTransAmount()) 
print ("CardType: " + resp.getCardType()) 
print ("TransID: " + resp.getTransID()) 
print ("TimedOut: " + resp.getTimedOut()) 
print ("AvsResultCode: " + resp.getAvsResultCode())
print ("CvdResultCode: " + resp.getCvdResultCode())
#Resolver Data