# Python 2import urllib2, urllibfrom urlparse import parse_qsdata ={}data["xKey"]=""# Credentialdata["xVersion"]=""# API Versiondata["xSoftwareName"]=""# Name of your softwaredata["xSoftwareVersion"]=""# Version of your softwaredata["xCommand"]=""data["xCardNum"]=""data["xExp"]=""data["xName"]=""data["xAmount"]=""data["xAccount"]=""data["xMagstripe"]=""data["xToken"]=""data["xCustom01"]=""data["xCVV"]=""data["xStreet"]=""data["xZip"]=""data["xBillFirstName"]=""data["xBillMiddleName"]=""data["xBillLastName"]=""data["xBillCompany"]=""data["xBillStreet"]=""data["xBillStreet2"]=""data["xBillCity"]=""data["xBillCountry"]=""data["xBillPhone"]=""data["xBillMobile"]=""data["xShipFirstName"]=""data["xShipMiddleName"]=""data["xShipCompany"]=""data["xShipStreet"]=""data["xShipStreet2"]=""data["xShipCity"]=""data["xShipState"]=""data["xShipZip"]=""data["xShipCountry"]=""data["xShipPhone"]=""data["xShipMobile"]=""data["xRefNum"]=""data["xAuthCode"]=""data["xIP"]=""data["xRouting"]=""data["xCardpresent"]=""data["xDUKPT"]=""data["xTax"]=""data["xTip"]=""data["xInvoice"]=""data["xPONum"]=""data["xComments"]=""data["xDescription"]=""data["xEmail"]=""data["xFax"]=""data["xBillState"]=""data["xAllowPartialAuth"]=""data["xRxAmount"]=""data["xDentalAmount"]=""data["xVisionAmount"]=""data["xTransitAmount"]=""data["xCopayAmount"]=""data["xClinicalAmount"]=""data["xOrderID"]=""data["xExistingCustomer"]=""data["xAllowDuplicate"]=""data["xMICR"]=""data["xCheckNum"]=""data["xCheckImageFront"]=""data["xCheckImageBack"]=""data["xVoucherApproval"]=""data["xVoucherSerial"]=""data["xGatewayRefNum"]=""data["xGatewayResult"]=""data["xGatewayError"]=""data["xGatewayCVV"]=""data["xGatewayAVS"]=""data["xOrderItems"]=""data["xOrderType"]=""data["xCustomerComments"]=""data["xShipMethod"]=""data["xShipAmount"]=""request = urllib2.Request("https://x1.cardknox.com/gateway", urllib.urlencode(data).encode('utf-8'))rawResponse = urllib2.urlopen(request).read().decode('utf-8')response =parse_qs(rawResponse, keep_blank_values=True)print("xRefNum: "+"".join(response.get("xRefNum","")));print("xResult: "+"".join(response.get("xResult","")));print("xStatus: "+"".join(response.get("xStatus","")));print("xError: "+"".join(response.get("xError","")));
Python 3
# Python 3import urllib.requestfrom urllib.parse import parse_qsdata ={}data["xKey"]=""# Credentialdata["xVersion"]=""# API Versiondata["xSoftwareName"]=""# Name of your softwaredata["xSoftwareVersion"]=""# Version of your softwaredata["xCommand"]=""data["xCardNum"]=""data["xExp"]=""data["xName"]=""data["xAmount"]=""data["xAccount"]=""data["xMagstripe"]=""data["xToken"]=""data["xCustom01"]=""data["xCVV"]=""data["xStreet"]=""data["xZip"]=""data["xBillFirstName"]=""data["xBillMiddleName"]=""data["xBillLastName"]=""data["xBillCompany"]=""data["xBillStreet"]=""data["xBillStreet2"]=""data["xBillCity"]=""data["xBillCountry"]=""data["xBillPhone"]=""data["xBillMobile"]=""data["xShipFirstName"]=""data["xShipMiddleName"]=""data["xShipCompany"]=""data["xShipStreet"]=""data["xShipStreet2"]=""data["xShipCity"]=""data["xShipState"]=""data["xShipZip"]=""data["xShipCountry"]=""data["xShipPhone"]=""data["xShipMobile"]=""data["xRefNum"]=""data["xAuthCode"]=""data["xIP"]=""data["xRouting"]=""data["xCardpresent"]=""data["xDUKPT"]=""data["xTax"]=""data["xTip"]=""data["xInvoice"]=""data["xPONum"]=""data["xComments"]=""data["xDescription"]=""data["xEmail"]=""data["xFax"]=""data["xBillState"]=""data["xAllowPartialAuth"]=""data["xRxAmount"]=""data["xDentalAmount"]=""data["xVisionAmount"]=""data["xTransitAmount"]=""data["xCopayAmount"]=""data["xClinicalAmount"]=""data["xOrderID"]=""data["xExistingCustomer"]=""data["xAllowDuplicate"]=""data["xMICR"]=""data["xCheckNum"]=""data["xCheckImageFront"]=""data["xCheckImageBack"]=""data["xVoucherApproval"]=""data["xVoucherSerial"]=""data["xGatewayRefNum"]=""data["xGatewayResult"]=""data["xGatewayError"]=""data["xGatewayCVV"]=""data["xGatewayAVS"]=""data["xOrderItems"]=""data["xOrderType"]=""data["xCustomerComments"]=""data["xShipMethod"]=""data["xShipAmount"]=""request = urllib.request.Request("https://x1.cardknox.com/gateway", urllib.parse.urlencode(data).encode('utf-8'))rawResponse = urllib.request.urlopen(request).read().decode('utf-8')response =parse_qs(rawResponse, keep_blank_values=True)print("xRefNum: "+"".join(response.get("xRefNum","")));print("xResult: "+"".join(response.get("xResult","")));print("xStatus: "+"".join(response.get("xStatus","")));print("xError: "+"".join(response.get("xError","")));
VB.NET
'Request
Dim MyPost As New System.Collections.Specialized.NameValueCollection
MyPost.Add("xKey", "") ‘Credential
MyPost.Add("xVersion", "4.5.5") ‘API Version
MyPost.Add("xSoftwareName", My.Application.Info.Title) ‘Name of your software
MyPost.Add("xSoftwareVersion", My.Application.Info.Version.ToString) ‘Version of your software
MyPost.Add("xCommand", "cc:sale")
MyPost.Add("xCardNum", "")
MyPost.Add("xExp", "")
MyPost.Add("xName", "")
MyPost.Add("xAmount", "")
MyPost.Add("xAccount", "")
MyPost.Add("xMagstripe", "")
MyPost.Add("xToken", "")
MyPost.Add("xCustom01", "")
MyPost.Add("xCVV", "")
MyPost.Add("xStreet", "")
MyPost.Add("xZip", "")
MyPost.Add("xBillFirstName", "")
MyPost.Add("xBillMiddleName", "")
MyPost.Add("xBillLastName", "")
MyPost.Add("xBillCompany", "")
MyPost.Add("xBillStreet", "")
MyPost.Add("xBillStreet2", "")
MyPost.Add("xBillCity", "")
MyPost.Add("xBillZip", "")
MyPost.Add("xBillCountry", "")