Home > Developers: Integration Overview > Transparent Database Engine > ASP: Transparent Database Engine

Use of this integration template requires intermediate- to advanced-level programming capability. eProcessing Network offers support for this template via email only at devutils@eprocessingnetwork.com.

eProcessing Network offers the following sample ASP source code to assist developers in integrating the eProcessing Network Transparent Database Engine Template for payment processing.

To process transactions from a Web server using ASP, installation of Microsoft's MSXML 3.0 is required. It contains a server-side specific version of the XMLHTTP component for use in Web or Application servers. If you need to install this free component, you can download it here. If you don't have it installed, you may get the error: Invalid ProgID when you execute Server.CreateObject("Microsoft.XMLHTTP").

Please note the following:

  • The sample source code shown below uses hard-coded values. You, as a programmer, must replace these hard-coded values with the values you prompt customers for.
  • The hard-coded test account number can be used if you do not yet have an eProcessing Network account. A test transaction can be run at anytime by simply using the merchant's eProcessing Network account number as the credit card number, regardless of whether you are using a test account number or a live account number.
  • ExpMonth and ExpYear must both be in two-digit format or you will very definitely achieve unexpected results because of the different ways issuing banks process transactions.

The required format of the variable names to pass to the eProcessing Network Transparent Database Engine Template is as follows:

ePNAccount, CardNo, ExpMonth, ExpYear, Total, Address, Zip

It is assumed here that the programmer will populate these variables from values obtained from customers visiting a merchants' website.

<%

Response.Buffer = True
Dim objXMLHTTP, xml

'Create & initialize the XMLHTTP object
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

sRemoteURL = "https://www.eprocessingnetwork.com/cgi-bin/tdbe/transact.pl"

'Open the connection to the remote server
xml.Open "POST", sRemoteURL, False

'Send the request to the eProcessing Network Transparent Database Engine
xml.Send "ePNAccount=05971&CardNo=05971&ExpMonth=10&ExpYear=01" & _
"&Total=12.95&Address=123&Zip=12345&HTML=No"

'store the response
sResponse = xml.responseText

Response.Write "<html><body>"

'parse the response string and handle appropriately
sApproval = mid(sResponse, 2, 1)

if sApproval = "Y" then
Response.Write "Your transaction has been approved with the " & _
"following response: <b>" & mid(sResponse, 3, 16) & "</b><br>"

    iPosition = instr(sResponse, ",")
if iPosition > 0 then
iAvsLength = len(sResponse) - iPosition - 2
Response.Write "AVS Response: <b>" & _
mid(sResponse, iPosition + 2, iAvsLength) & "</b>"
end if
elseif sApproval = "N" then
Response.Write "Your transaction has been declined with the " & _
"following response: <b>" & mid(sResponse, 3, 16) & "</b><br>"
else
Response.Write "The processor was unable to handle your " & _
"transaction, having returned the following response: <b>" & _
sResponse & "</b><br>"
end if

Response.Write "</body></html>"

Set xml = Nothing
%>

By default, the eProcessing Network Transparent Database Engine Template outputs its' response in HTML format, i.e. wrapped in <html> and <body> tags, which can often aid in testing. Sending the additional variable HTML set to No causes the template to output the response without the HTML tags.

After the transaction has been processed, the banks' response to the transaction, as well as the Address Verification System response, are output as follows:

With HTML:

<html><body>"YAUTH/TKT 019829","Address and Zip Code Do Not Match"</body></html>

Without HTML:

"YAUTH/TKT 019829","Address and Zip Code Do Not Match"

The response is essentially two quoted, comma-delimited strings. The first string always starts with a Y (Yes, approved), an N (No, declined) or a U (No, unable), and is followed by up to 16 characters describing the response. The second string is the Address Verification Systems' response to the street address and Zip code supplied.

 

For questions, suggestions or special requests, email us at devutils@eprocessingnetwork.com.

Facebook   LinkedIn   YouTube
Copyright 2014 eProcessing Network, LLC. All Rights Reserved.