HeartLand Payment Gateway

Wednesday, December 16, 2009

How to integrate HeartLand Payment Gateway in your website ?


Solution :

Step 1 : Create project in visual studio and add three files with named below,

1.CheckoutPage.aspx
2.ProcessPage.aspx
3.ProcessReturnPage.aspx

Put below code in respective file name as shown below.

1.CheckoutPage.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected string _strTransNum = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
//TODO
//Initialize variable this._strTransNum below by assiging it the transaction number that is to be processed. It must not to be empty.
this._strTransNum = "IN123456";
//END
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Purchase Page</title>
<style type="text/css">
Body { background-color:RGB(255,255,255);}
.BT_BtnOut { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_BtnOvr { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_Field { FONT-SIZE: 8pt; font-family : Arial;COLOR: RGB(0,0,0);}
.BT_FieldDescription { FONT-WEIGHT: bold; FONT-SIZE: 8pt; font-family : Arial; COLOR : RGB(0,0,0);}
</style></head>
<body>
<div>
<form id="PurchaseForm" runat="server">
<input type="hidden" id="TransactionNumber" value="<%=this._strTransNum %>" />
<div id="PaymentMethodDiv" style="width:580px; height:400px; text-align:center; vertical-align:middle">
<table style="width:100%; height:100%">
<tr>
<td style="vertical-align:middle; text-align:center">
<table width="260px">
<tr>
<td style="text-align:right">
<input id="rbCreditCard" type="radio" checked="checked" name="PaymentMethod"/><span class="BT_Field">Credit Card</span></td>
</tr>
<tr>
<td style="text-align:right" colspan="2">
<input id="btnNext" type="button" value="Next >>" onclick="Next();" class="BT_BtnOut"
onmouseover="this.className='BT_BtnOvr'" onmouseout="this.className='BT_BtnOut';"/></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="ProcessDiv" style="display:none;">
<table>
<tr>
<td>
<!--You can adjust the iframe's height and width below in terms of pixels to your like-->
<iframe id="ProcessPage" style="overflow:hidden" height="750px" width="700px" frameborder="0"></iframe>
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">
function Next()
{
document.getElementById('PaymentMethodDiv').style.display='none';
var processURL = "ProcessPage.aspx?No="+document.getElementById('TransactionNumber').value+"&ProcessType=";
processURL = processURL + "CreditCard";
document.getElementById('ProcessPage').src=processURL;
document.getElementById('ProcessDiv').style.display='block';
}
function Back()
{
document.getElementById('ProcessDiv').style.display='none';
document.getElementById('ProcessPage').src=null;
document.getElementById('PaymentMethodDiv').style.display='block';
}
function Change(index){}
</script>
</div>
</body>
</html>



2.ProcessPage.aspx


<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected string _strRedirectURL = string.Empty;
protected string _strVerifyNum = string.Empty;
protected string _strProcessType = string.Empty;
protected string _strTransType = string.Empty;
protected string _strMerchantID = string.Empty;
protected double _totalAmount = 0;
protected string _strTransNum = string.Empty;
protected string _strReturnURL = string.Empty;

//TODO
//Assign the name of the cardholder to variable strNameOnCard below.
protected string strNameOnCard = string.Empty;
//END

//TODO
//Assign the street address of the cardholder to variable strAddress below.
protected string strAddress = string.Empty;
//END

//TODO
//Assign the city of the cardholder to variable strCity below.
protected string strCity = string.Empty;
//END

//TODO
//Assign the state of the cardholder to variable strState below.
protected string strState = string.Empty;
//END

//TODO
//Assign the zip code of the cardholder to variable strZip below.
protected string strZip = string.Empty;
//END

//TODO
//Assign a page title for the process page to variable strPageTitle below.
protected string strPageTitle = string.Empty;
//END

//TODO
//Assign a transaction information title to variable strTxnsTitle below.
protected string strTxnsTitle = string.Empty;
//END

//TODO
//Assign a transaction number to variable strTxnsNum below.
protected string strTxnsNum = string.Empty;
//END

//TODO
//Assign a transaction amount to variable strTxnsAmount below.
protected string strTxnsAmount = string.Empty;
//END

//TODO
//Assign a convenience fee to variable strCONFee below.
protected string strCONFee = string.Empty;
//END

//TODO
//Assign a total amount to variable strTotalAmount below.
protected string strTotalAmount = string.Empty;
//END

//TODO
//Assign a Finish button to variable strFinishButton below.
protected string strFinishButton = string.Empty;
//END

//TODO
//Assign the total attempts number and used attempts number.
protected string strTotalAttempts = "0";
protected string strUsedAttempts = "0";
//END

//TODO
//Assign a Contact Phone to variable strContactPhone below.
protected string strContactPhone = string.Empty;
//END

//TODO
//Assign a variable strPromptCancel below to show Prompt Cancel on the WebConnect page.
//Value is Yes or No.
protected string strPromptCancel = string.Empty;
//END

//TODO
//Assign a variable strShowTransNo below to show transaction number on the WebConnect page.
//Value is Yes or No.
protected string strShowTransNo = string.Empty;
//END

//TODO
//Assign variable strCustomerID, strCustomerName below to store customer number and customer name for the WebConnect page.
protected string strCustomerID = "TestCustomer";
protected string strCustomerName = "TestCustomer";
//END

//TODO
//Assign variable strPONum below to store purchase order number for the WebConnect page.
protected string strPONum = string.Empty;
//END

//TODO
//Assign variable strInvoiceNum below to store invoice number for the WebConnect page.
protected string strInvoiceNum = string.Empty;
//END

//TODO
//Assign variable strFirstName below to store first name for the WebConnect page.
protected string strFirstName = string.Empty;
//END

//TODO
//Assign variable strLastName below to store last name for the WebConnect page.
protected string strLastName = string.Empty;
//END

//TODO
//Assign variable strTaxAmount below to store tax amount for the WebConnect Level II transaction.
protected string strTaxAmount = string.Empty;
//END

//TODO
//Assign variable strCustomerFirstName below to store customer's first name for the WebConnect page.
protected string strCustomerFirstName = string.Empty;
//END

//TODO
//Assign variable strCustomerLastName below to store customer's last name for the WebConnect page.
protected string strCustomerLastName = string.Empty;
//END

//TODO
//Assign variable strCustomerStreet2 below to store customer's Street 2 for the WebConnect page.
protected string strCustomerStreet2 = string.Empty;
//END

//TODO
//Assign variable strCustomerStreet3 below to store customer's Street 3 for the WebConnect page.
protected string strCustomerStreet3 = string.Empty;
//END

//TODO
//Assign variable strCustomerEmail below to store customer's Email for the WebConnect page.
protected string strCustomerEmail = string.Empty;
//END

//TODO
//Assign variable strCustomerDayPhone below to store customer's Daytime Phone for the WebConnect page.
protected string strCustomerDayPhone = string.Empty;
//END

//TODO
//Assign variable strCustomerNightPhone below to store customer's Night Phone for the WebConnect page.
protected string strCustomerNightPhone = string.Empty;
//END

//TODO
//Assign variable strCustomerMobile below to store customer's Mobile Phone for the WebConnect page.
protected string strCustomerMobile = string.Empty;
//END

//TODO
//Assign variable strCustomerFax below to store customer's Fax for the WebConnect page.
protected string strCustomerFax = string.Empty;
//END

//TODO
//Assign variable strCustomerProvince below to store customer's Province for the WebConnect page.
protected string strCustomerProvince = string.Empty;
//END

//TODO
//Assign variable strCustomerCountry below to store customer's Country for the WebConnect page.
protected string strCustomerCountry = string.Empty;
//END

protected void Page_Load(object sender, EventArgs e)
{
this._strProcessType = Request["ProcessType"].ToString(); //CreditCard,GSBCard or Check
this._strTransNum = Request["No"].ToString(); //Transaction Number
_strTransType = "Auth";

//TODO
//Assign a verification number to the variable this._strVerifyNum below. You can use the session's ID or a random number.
this._strVerifyNum = "IN123456";
//Store the verification number to the session. This verification number will be used to verify the request once the request is passed back from the WebConnect Portal with a result.
if (Session["TxnsVFNumb"] == null)
{
Session.Add("TxnsVFNumb", this._strVerifyNum);
}
else
{
Session["TxnsVFNumb"] = this._strVerifyNum;
}
//END

//TODO
//Assign your website's URL to the variable strURL below.
string strURL = "http://localhost/MyURL/";
//END
if (strURL.Substring(strURL.Length - 1, 1).Equals("/"))
{
strURL = strURL.Substring(0, (strURL.Length - 1));
}
this._strReturnURL = (strURL + "/ProcessReturnPage.aspx");
//TODO
//Assign the WebConnect Portal's URL to the variable this._strRedirectURL below.
this._strRedirectURL = "https://hps.webportal.test.secureexchange.net";
//END

if (_strRedirectURL.Substring(_strRedirectURL.Length - 1, 1).Equals("/"))
{
_strRedirectURL = _strRedirectURL.Substring(0, (_strRedirectURL.Length - 1));
}
this._strRedirectURL = (this._strRedirectURL + "/PaymentMain.aspx");

this.LoadAndChangeTransactionInformation();
this.LoadMerchantInformation();
}

protected void LoadAndChangeTransactionInformation()
{
//TODO
//Assign basic transaction information (i.e. the total amount of the transaction) to the variable this._totalAmount below. It must be number with 2 decimal places.
this._totalAmount = 0;
//END
//You can change the transaction's status or other information below inside this function.
}

protected void LoadMerchantInformation()
{
//TODO
//Assign the merchant's information, such as WebConnect User ID to the variable this._strMerchantID below.
this._strMerchantID = "XYZ";
//END
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Process Page</title>
<style type="text/css">
Body { background-color:RGB(255,255,255);}
.BT_BtnOut { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_BtnOvr { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_Field { FONT-SIZE: 8pt; font-family : Arial;COLOR: RGB(0,0,0);}
.BT_FieldDescription { FONT-WEIGHT: bold; FONT-SIZE: 8pt; font-family : Arial; COLOR : RGB(0,0,0);}
</style></head>
<body>
<div>
<form id="ProcessForm" runat="server">
<input type="hidden" name="ClientSessionID" value="<%=this._strVerifyNum %>" />
<input type="hidden" name="ProcessType" value="<%=this._strProcessType %>" />
<input type="hidden" name="TransType" value="<%=this._strTransType %>" />
<input type="hidden" name="UserName" value="<%=this._strMerchantID %>" />
<input type="hidden" name="Amount" value="<%=this._totalAmount.ToString("F2") %>" />
<input type="hidden" name="TransNum" value="<%=this._strTransNum %>" />
<input type="hidden" name="ReturnURL" value="<%=this._strReturnURL %>" />
<input type="hidden" name="HasHeader" value="true" />
<input type="hidden" name="NameOnCard" value="<%=strNameOnCard %>" />
<input type="hidden" name="Address" value="<%=strAddress %>" />
<input type="hidden" name="City" value="<%=strCity %>" />
<input type="hidden" name="State" value="<%=strState %>" />
<input type="hidden" name="Zip" value="<%=strZip %>" />
<input type="hidden" name="PageTitle" value="<%=strPageTitle %>" />
<input type="hidden" name="TxnsTitle" value="<%=strTxnsTitle %>" />
<input type="hidden" name="TxnsNumCaption" value="<%=strTxnsNum %>" />
<input type="hidden" name="TxnsAmountCaption" value="<%=strTxnsAmount %>" />
<input type="hidden" name="CONFeeCaption" value="<%=strCONFee %>" />
<input type="hidden" name="TotalAmountCaption" value="<%=strTotalAmount %>" />
<input type="hidden" name="FinishButtonCaption" value="<%=strFinishButton %>" />
<input type="hidden" name="TotalAttempts" value="<%=strTotalAttempts %>" />
<input type="hidden" name="UsedAttempts" value="<%=strUsedAttempts %>" />
<input type="hidden" name="ContactPhone" value="<%=strContactPhone %>" />
<input type="hidden" name="PromptCancel" value="<%=strPromptCancel %>" />
<input type="hidden" name="ShowTransNo" value="<%=strShowTransNo %>" />
<input type="hidden" name="CanSaveCard" value="Yes" />
<input type="hidden" name="CustomerID" value="<%=strCustomerID %>" />
<input type="hidden" name="CustomerName" value="<%=strCustomerName %>" />
<input type="hidden" name="PONum" value="<%=strPONum %>" />
<input type="hidden" name="InvoiceNo" value="<%=strInvoiceNum %>" />
<input type="hidden" name="FirstName" value="<%=strFirstName %>" />
<input type="hidden" name="LastName" value="<%=strLastName %>" />
<input type="hidden" name="TaxAmount" value="<%=strTaxAmount %>" />
<input type="hidden" name="CustomerFirstName" value="<%=strCustomerFirstName %>" />
<input type="hidden" name="CustomerLastName" value="<%=strCustomerLastName %>" />
<input type="hidden" name="CustomerStreet2" value="<%=strCustomerStreet2 %>" />
<input type="hidden" name="CustomerStreet3" value="<%=strCustomerStreet3 %>" />
<input type="hidden" name="CustomerEmail" value="<%=strCustomerEmail %>" />
<input type="hidden" name="CustomerDayPhone" value="<%=strCustomerDayPhone %>" />
<input type="hidden" name="CustomerNightPhone" value="<%=strCustomerNightPhone %>" />
<input type="hidden" name="CustomerMobile" value="<%=strCustomerMobile %>" />
<input type="hidden" name="CustomerFax" value="<%=strCustomerFax %>" />
<input type="hidden" name="CustomerProvince" value="<%=strCustomerProvince %>" />
<input type="hidden" name="CustomerCountryID" value="<%=strCustomerCountry %>" />
</form>
</div>
</body>
<script type="text/javascript">
window.onload=function()
{
document.forms[0].action = "<%=this._strRedirectURL%>";
document.forms[0].submit();
}
document.getElementById('__VIEWSTATE').parentNode.removeChild(document.getElementById('__VIEWSTATE'));
</script>
</html>



3.ProcessReturnPage.aspx


<%@ Page Language="C#" EnableViewState="false" EnableViewStateMac="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected int _intResultNum = -1;
protected string _strJSCode = string.Empty;
protected string strTransNum = string.Empty;
protected string strReferenceNumber = string.Empty;
protected string strAuthorizationCode = string.Empty;
protected string strResultNum = string.Empty;
protected string strUsedAttempts = string.Empty;
protected string strCardType = string.Empty;
protected string strCardNumber = string.Empty;
protected string strInvoiceNum = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
if (Request["ResultNum"] == null)
{
this._intResultNum = -1;
return;
}
else
{
this._intResultNum = Convert.ToInt32(Request["ResultNum"].ToString());
}

if (Request["TransNum"] == null)
{
this._intResultNum = -1;
return;
}

if (Request["ClientSessionID"] == null)
{
this._intResultNum = -1;
return;
}

if (String.IsNullOrEmpty((Request["TransNum"].ToString()))
OR String.IsNullOrEmpty(Convert.ToString(Request["ClientSessionID"]))
OR (this._intResultNum == -1)
OR (Session["TxnsVFNumb"] == null)
OR !Session["TxnsVFNumb"].ToString().Equals(Convert.ToString(Request["ClientSessionID"])))
{
this._intResultNum = -1;
return;
}

strTransNum = Convert.ToString(Request["TransNum"]);
strReferenceNumber = Convert.ToString(Request["ReferenceNumber"]);
strAuthorizationCode = Convert.ToString(Request["AuthorizationCode"]);
strResultNum = Convert.ToString(Request["ResultNum"]);

if (Request["CardNumber"] != null)
{
strCardNumber = "The last 4 card number is " + Request["CardNumber"].ToString();
}
else if (Request["AccountNumber"] != null)
{
strCardNumber = "You checking account number is " + Request["AccountNumber"].ToString();
}

if (Request["UsedAttempts"] != null)
{
strUsedAttempts = Request["UsedAttempts"].ToString();
}
else
{
strUsedAttempts = "0";
}

if (Request["CardType"] != null)
{
strCardType = Request["CardType"].ToString();
}
else
{
strCardType = "";
}

if (Request["InvoiceNum"] != null)
{
strInvoiceNum = Request["InvoiceNum"].ToString();
}
else
{
strInvoiceNum = "";
}

if (this._intResultNum == 0)
{
this.ChangeTransactionStatus();
//TODO
//You can modify the following JavaScript code to redirect to other URL.
_strJSCode = "window.onload = function(){document.getElementById('ResultInfor').style.display='block';";
_strJSCode += " document.getElementById('ResultMessage').style.display='block';}";
//END
}
else if (this._intResultNum == 3)
{
//TODO
//You can modify the following JavaScript code to set the message.
_strJSCode = "window.onload = function(){document.getElementById('ResultMessage').style.display='block';";
_strJSCode += "document.getElementById('lblNotes').innerHTML='The transaction has been canceled because the Max.attempts reached.';}";
//END
}
else if (this._intResultNum == 4)
{
//TODO
//You can modify the following JavaScript code to set the message.
_strJSCode = "window.onload = function(){document.getElementById('ResultMessage').style.display='block';";
_strJSCode += "document.getElementById('lblNotes').innerHTML='The session has timed out.';}";
//END
}
else
{
_strJSCode = "window.onload = function(){parent.Back();}";
}
}

protected void ChangeTransactionStatus()
{
//TODO
//You can change the transaction's status inside this function.
//END
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Process Return Page</title>
<style type="text/css">
Body { background-color:RGB(255,255,255);}
.BT_BtnOut { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_BtnOvr { Width:70px; font-size: 9pt; font-weight:bold;COLOR: RGB(0,0,0);font-family : Arial;}
.BT_Field { FONT-SIZE: 8pt; font-family : Arial;COLOR: RGB(0,0,0);}
.BT_FieldDescription { FONT-WEIGHT: bold; FONT-SIZE: 8pt; font-family : Arial; COLOR : RGB(0,0,0);}
</style></head>
<body>
<div>
<form id="ProcessReturnForm" runat="server">
<table id="ResultInfor" style="display:none">
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Transaction Number :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strTransNum %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Reference Number :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strReferenceNumber %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Authorization Code :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strAuthorizationCode %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Result Number :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strResultNum %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Used Attempts :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strUsedAttempts %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Card Type :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strCardType %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Card Number :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strCardNumber %></a></td>
</tr>
<tr>
<td style="text-align:right; width:200px">
<a class="BT_FieldDescription">Invoice Number :</a></td>
<td style="text-align:left; width:200px"><a class="BT_Field"><%=strInvoiceNum %></a></td>
</tr>
</table>
<table id="ResultMessage" style="display:none">
<tr>
<td style="text-align:center; height:50px" colspan="2">
<a id="lblNotes" class="BT_FieldDescription">You have been charged successfully.</a></td>
</tr>
<%if (this._intResultNum == 0) { %>
<tr>
<td style="text-align: right" colspan="2">
<input id="btnPrint" type="button" value="Print" onclick="window.print();" class="BT_BtnOut"
onmouseover="this.className='BT_BtnOvr'" onmouseout="this.className='BT_BtnOut';"/>
<input type="button" value="Colse" onclick="javascript:Back();" class="BT_BtnOut"
onmouseover="this.className='BT_BtnOvr'" onmouseout="this.className='BT_BtnOut';" /></td>
</tr>
<% } else {%>
<tr>
<td style="text-align: right" >
<input type="button" value="Colse" onclick="javascript:Back();" class="BT_BtnOut"
onmouseover="this.className='BT_BtnOvr'" onmouseout="this.className='BT_BtnOut';" /></td>
</tr>
<% } %>
</table>
</form>
</div>
<script type="text/javascript">
function Back()
{
top.opener=null;
top.open("","_self");
top.close();
window.close();
}
<%
Response.Write(this._strJSCode);
%>
</script>
</body>
</html>





Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
rajesh@indianic.com

My Blog : Click Here

Variable Used During Integration of HeartLand Payment Gateway

1. Process Credit Card

(1)When the customer website redirect to the web portal, it should send these information to the web portal.

Field Name

Description

Value

Optional

ClientSessionID

The session’s ID of customer website, it will be returned when the process is finished.

No

ProcessType

The process type.

CreditCard

No

TransType

Transaction type

Auth

Sale

No

UserName

The user name assigned by the payment gateway.

No

Amount

The transaction amount. The amount must in DDDDD.CC format.

No

TransNum

The transaction number.

No

ReturnURL

The URL which is redirected when the process is finished.

The URL must begin with http:// or https://

No

CanSaveCard

The user can process payment by using the existing Card/Check or not. Default value is “No”.

Yes

No

Yes

CustomerID

The merchant’s client customer ID. This is a unique ID for each customer. It is used to verify the customer’s information and filter the payment profile of the customer.

Please format the value of this field as “Your website alias_The customer unique ID in your website”.

For example: If the alias of your website is “TW”, the customer unique ID in your website is “12345”, format the value of this field as: “TW_12345

This field only can be used when the value of the field “CanSaveCard” is “Yes”.

Format the value as the blue part.

Required when the value of the field “CanSaveCard” is “Yes”

CustomerName

The merchant’s client customer name.

This field only can be used when the value of the field “CanSaveCard” is “Yes”.

Required when the value of the field “CanSaveCard” is “Yes”

PageTitle

The page title of process page.

Yes

HasHeader

Does the process page have header or not? If the process page is included in the page of customer website, this value will be “false”.

true

false

No

NameOnCard

The name on the credit card.

Yes

Address

The card holder’s address.

Yes

City

The card holder’s city.

Yes

State

The card holder’s 2 character state code. Such as AL ‘.

Yes

Zip

The card holder’s zip. The zip code must be 5-digit such as ‘12345’.

Yes

TxnsTitle

The tile of the transaction function part. If this value is blank, it will use the default description

Yes

TxnsNumCaption

The caption of the transaction number. You can change the caption of the transaction number with your personal caption. If this value is blank, it will use the default description

Yes

TxnsAmountCaption

The caption of the transaction amount. You can change the caption of the transaction amount with your personal caption. If this value is blank, it will use the default description

Yes

CONFeeCaption

The caption of the convenience fee. You can change the caption of the convenience fee with your personal caption. If this value is blank, it will use the default description

Yes

TotalAmountCaption

The caption of the total amount. You can change the caption of the total amount with your personal caption. If this value is blank, it will use the default description

Yes

FinishButtonCaption

The caption of the “Finish” button. You can change the caption of the “Finish” button with your personal caption. If this value is blank, it will use the default description

Yes

TotalAttempts

The total number of attempts allowed for processing the credit card/ checking account payment transaction. Must be an integer.

Yes

UsedAttempts

The number of attempts used for processing the credit card/ checking account payment transaction. Must be integer.

Yes

PromptCancel

Setting to display a confirmation prompt when the user wants to cancel the transaction.

Yes

No

Yes

ShowTransNo

Setting to display the transaction number on the page.

Yes

No

Yes

InvocieNo

The invocie number.

The value of this field will be sent to HPS merchant center. But if the value of this field is blank, WebConnect will use the value of the field “TransNum” as the default value.

Yes

IsQuickCheckout

Whether this process is sent form the Quick Checkout Portal.

Yes

No

Yes

CustomerFirstName

The merchant’s client customer’s first name.

Yes

CustomerLastName

The merchant’s client customer’s last name.

Yes

CustomerStreet2

The merchant’s client customer’s street 2.

Yes

CustomerStreet3

The merchant’s client customer’s street 3.

Yes

CustomerEmail

The merchant’s client customer’s email address.

Yes

CustomerDayPhone

The merchant’s client customer’s daytime phone.

Yes

CustomerNightPhone

The merchant’s client customer’s night phone.

Yes

CustomerMobile

The merchant’s client customer’s mobile.

Yes

CustomerFax

The merchant’s client customer’s fax.

Yes

CustomerProvince

The merchant’s client customer’s province.

Yes

CustomerCountryID

The merchant’s client customer’s country ID.

Yes

PONum

For purchase order number. (Note* This is to be used for Level II information except Global Payments.)

Yes

TaxAmount

For tax amount in DDDD.CC format. (Note* This is to be used for Level II information except Global Payments.)

Yes

(2)When the web portal finished processing credit card, it will return this information to the customer website.

Field Name

Description

Value

ClientSessionID

The session’s ID of customer website.

TransNum

The transaction number.

ResultNum

The result number for processing credit card.

0=Successful

1=Canceled

2=Back

3=MaxAttempts

4=TimeOut (The session will be time out after 15 minutes)

AuthorizationCode

The authorization code assigned by the payment gateway.

ReferenceNumber

The reference number assigned by the payment gateway.

CardNumber

The last 4 digit of credit card number.

CardType

The card type of the credit card used for the transaction.

UsedAttempts

The number of attempts used for processing the credit card payment transaction. Must be an integer.

2. Process Check

(1) When the customer website redirect to the web portal, it should send these information to the web portal.

Field Name

Description

Value

Optional

ClientSessionID

The session’s ID of customer website, it will be returned when the process is finished.

No

ProcessType

The process type.

Check

No

TransType

Transaction type

Sale

No

UserName

The user name assigned by the payment gateway.

No

Amount

The transaction amount. The amount must in DDDDD.CC format.

No

TransNum

The transaction number.

No

ReturnURL

The URL which is redirected when the process is finished.

The URL must begin with http:// or https://

No

CanSaveCard

The user can process payment by using the existing Card/Check or not. Default value is “No”.

Yes

No

No

CustomerID

The merchant’s client customer ID. This is a unique ID for each customer. It is used to verify the customer’s information and filter the payment profile of the customer.

Please format the value of this field as “Your website alias_The customer unique ID in your website”.

For example: If the alias of your website is “TW”, the customer unique ID in your website is “12345”, format the value of this field as: “TW_12345

This field only can be used when the value of the field “CanSaveCard” is “Yes”.

Format the value as the blue part.

Required when the value of the field “CanSaveCard” is “Yes”

CustomerName

The merchant’s client customer name.

This field only can be used when the value of the field “CanSaveCard” is “Yes”.

Required when the value of the field “CanSaveCard” is “Yes”

PageTitle

The page title of process page.

Yes

HasHeader

If the process page has header or not. If the process page is included in the page of customer website, this value will be “false”.

true

false

No

NameOnCheck

The name on the check.

Yes

Address

The check holder’s address.

Yes

City

The check holder’s city.

Yes

State

The check holder’s 2 character state code. Such as AL ‘.

Yes

Zip

The check holder’s zip. The zip code must be 5-digit such as ‘12345.’

Yes

ContactPhone

The card holder’s contact phone.

Yes

TxnsTitle

The tile of the transaction function part. If this value is blank, it will use the default description

Yes

TxnsNumCaption

The caption of the transaction number. You can change the caption of the transaction number with your personal caption. If this value is blank, it will use the default description

Yes

TxnsAmountCaption

The caption of the transaction amount. You can change the caption of the transaction amount with your personal caption. If this value is blank, it will use the default description

Yes

CONFeeCaption

The caption of the convenience fee. You can change the caption of the convenience fee with your personal caption. If this value is blank, it will use the default description

Yes

TotalAmountCaption

The caption of the total amount. You can change the caption of the total amount with your personal caption. If this value is blank, it will use the default description

Yes

FinishButtonCaption

The caption of the “Finish” button. You can change the caption of the “Finish” button with your personal caption. If this value is blank, it will use the default description

Yes

TotalAttempts

The total number of attempts allowed for processing the credit card/ checking account payment transaction. Must be an integer.

Yes

UsedAttempts

The number of attempts used for processing the credit card/ checking account payment transaction. Must be integer.

Yes

PromptCancel

Setting to display a confirmation prompt when the user wants to cancel the transaction.

Yes

No

Yes

ShowTransNo

Setting to display the transaction number on the page.

Yes

No

Yes

InvocieNo

The invocie number.

The value of this field will be sent to HPS merchant center. But if the value of this field is blank, WebConnect will use the value of the field “TransNum” as the default value.

Yes

PONum

The purchase order number.

Yes

IsQuickCheckout

Whether this process is sent form the Quick Checkout Portal.

Yes

No

Yes

CustomerFirstName

The merchant’s client customer’s first name.

Yes

CustomerLastName

The merchant’s client customer’s last name.

Yes

CustomerStreet2

The merchant’s client customer’s street 2.

Yes

CustomerStreet3

The merchant’s client customer’s street 3.

Yes

CustomerEmail

The merchant’s client customer’s email address.

Yes

CustomerDayPhone

The merchant’s client customer’s daytime phone.

Yes

CustomerNightPhone

The merchant’s client customer’s night phone.

Yes

CustomerMobile

The merchant’s client customer’s mobile.

Yes

CustomerFax

The merchant’s client customer’s fax.

Yes

CustomerProvince

The merchant’s client customer’s province.

Yes

CustomerCountryID

The merchant’s client customer’s country ID.

Yes

(2)When the web portal finished processing check, it will return this information to the customer website.

Field Name

Description

Value

ClientSessionID

The session’s ID of customer website.

TransNum

The transaction number.

ResultNum

The result number for processing check.

0=Successful

1=Canceled

2=Back

3=MaxAttempts

4=TimeOut (The session will be time out after 15 minutes)

AuthorizationCode

The authorization code assigned by the payment gateway.

ReferenceNumber

The reference number assigned by the payment gateway.

AccountNumber

The last 4 digit of account number.

CardType

The card type of the credit card which the user used for the transaction.

UsedAttempts

The number of attempts used for processing the checking account payment transaction. Must be an integer.

3. Process GSB Card

(1)When the customer website redirect to the web portal, it should send these information to the web portal.

Field Name

Description

Value

Optional

ClientSessionID

The session’s ID of customer website, it will be returned when the process is finished.

No

ProcessType

The process type.

GSBCard

No

TransType

Transaction type

Auth

Sale

No

UserName

The user name assigned by the payment gateway.

No

Amount

The transaction amount. The amount must in DDDDD.CC format.

No

TransNum

The transaction number.

No

ReturnURL

The URL which is redirected when the process is finished.

The URL must begin with http:// or https://

No

PageTitle

The page title of process page.

Yes

HasHeader

Does the process page have header or not? If the process page is included in the page of customer website, this value will be “false”.

true

false

No

FirstName

The card holder’s first name.

Yes

LastName

The card holder’s last name.

Address

The card holder’s address.

Yes

City

The card holder’s city.

Yes

State

The card holder’s 2 character state code. Such as AL ‘.

Yes

Zip

The card holder’s zip. The zip code must be 5-digit such as ‘12345’.

Yes

TxnsTitle

The tile of the transaction function part. If this value is blank, it will use the default description

Yes

TxnsNumCaption

The caption of the transaction number. You can change the caption of the transaction number with your personal caption. If this value is blank, it will use the default description

Yes

TxnsAmountCaption

The caption of the transaction amount. You can change the caption of the transaction amount with your personal caption. If this value is blank, it will use the default description

Yes

CONFeeCaption

The caption of the convenience fee. You can change the caption of the convenience fee with your personal caption. If this value is blank, it will use the default description

Yes

TotalAmountCaption

The caption of the total amount. You can change the caption of the total amount with your personal caption. If this value is blank, it will use the default description

Yes

FinishButtonCaption

The caption of the “Finish” button. You can change the caption of the “Finish” button with your personal caption. If this value is blank, it will use the default description

Yes

TotalAttempts

The total number of attempts allowed for processing the credit card/ checking account payment transaction. Must be an integer.

Yes

UsedAttempts

The number of attempts used for processing the credit card/ checking account payment transaction. Must be integer.

Yes

PromptCancel

Setting to display a confirmation prompt when the user wants to cancel the transaction.

Yes

No

Yes

ShowTransNo

Setting to display the transaction number on the page.

Yes

No

Yes

InvocieNo

The invocie number.

The value of this field will be sent to HPS merchant center. But if the value of this field is blank, WebConnect will use the value of the field “TransNum” as the default value.

Yes

IsQuickCheckout

Whether this process is sent form the Quick Checkout Portal.

Yes

No

Yes

CustomerFirstName

The merchant’s client customer’s first name.

Yes

CustomerLastName

The merchant’s client customer’s last name.

Yes

CustomerStreet2

The merchant’s client customer’s street 2.

Yes

CustomerStreet3

The merchant’s client customer’s street 3.

Yes

CustomerEmail

The merchant’s client customer’s email address.

Yes

CustomerDayPhone

The merchant’s client customer’s daytime phone.

Yes

CustomerNightPhone

The merchant’s client customer’s night phone.

Yes

CustomerMobile

The merchant’s client customer’s mobile.

Yes

CustomerFax

The merchant’s client customer’s fax.

Yes

CustomerProvince

The merchant’s client customer’s province.

Yes

CustomerCountryID

The merchant’s client customer’s country ID.

Yes

PONum

For purchase order number. (Note* This is to be used for Level II information except Global Payments.)

Yes

TaxAmount

For tax amount in DDDD.CC format. (Note* This is to be used for Level II information except Global Payments.)

Yes

(2)When the web portal finished processing credit card, it will return this information to the customer website.

Field Name

Description

Value

ClientSessionID

The session’s ID of customer website.

TransNum

The transaction number.

ResultNum

The result number for processing credit card.

0=Successful

1=Canceled

2=Back

3=MaxAttempts

4=TimeOut (The session will be time out after 15 minutes)

AuthorizationCode

The authorization code assigned by the payment gateway.

ReferenceNumber

The reference number assigned by the payment gateway.

CardNumber

The last 4 digit of credit card number.

CardType

The card type of the credit card used for the transaction.

UsedAttempts

The number of attempts used for processing the credit card payment transaction. Must be an integer.

4. How the customer website send information to the web portal.

(1) When the customer website redirect to the web portal, please submit the information in a form to redirect to the web portal. Do not send the information in the URL visibly for the security reason. You can write the code like this:

(a) Process Credit Card

<form method="POST" action="http://localhost/PaymentMain.aspx ">

<input type="hidden" name="ClientSessionID" >

<input type="hidden" name="ProcessType" >

<input type="hidden" name="TransType" >

<input type="hidden" name="UserName" >

<input type="hidden" name="Amount" >

<input type="hidden" name="TransNum" >

<input type="hidden" name="ReturnURL" >

<input type="hidden" name="PageTitle" >

<input type="hidden" name="HasHeader" >

<input type="hidden" name="NameOnCard" >

<input type="hidden" name="Address" >

<input type="hidden" name="City" >

<input type="hidden" name="State" >

<input type="hidden" name="Zip" >

<input type="hidden" name="TxnsTitle" >

<input type="hidden" name="TxnsNumCaption" >

<input type="hidden" name="TxnsAmountCaption" >

<input type="hidden" name="CONFeeCaption" >

<input type="hidden" name="TotalAmountCaption" >

<input type="hidden" name="FinishButtonCaption" >

<input type="hidden" name="TotalAttempts" >

<input type="hidden" name="UsedAttempts" >

<input type="hidden" name="PromptCancel" >

<input type="hidden" name="ShowTransNo" >

<input type="hidden" name="CanSaveCard" >

<input type="hidden" name="CustonerID" >

<input type="hidden" name=" CustonerName" >

<input type="hidden" name=" InvocieNo" >

<input type="hidden" name=" PONum" >

<input type="hidden" name=" IsQuickCheckout" >

<input type="hidden" name="CustomerFirstName" >

<input type="hidden" name="CustomerLastName" >

<input type="hidden" name="CustomerStreet2" >

<input type="hidden" name="Customer Street3" >

<input type="hidden" name="CustomerEmail" >

<input type="hidden" name="CustomerDayPhone" >

<input type="hidden" name="CustomerNightPhone" >

<input type="hidden" name=" CustomerMobile" >

<input type="hidden" name=" CustomerFax" >

<input type="hidden" name=" CustomerProvince" >

<input type="hidden" name=" CustomerCountryID" >

<input type="hidden" name=" TaxAmount" >

<input type="submit" value="submit" name=" submit ">

</form>

(b) Process Check

<form method="POST" action="http://localhost/PaymentMain.aspx ">

<input type="hidden" name="ClientSessionID " >

<input type="hidden" name="ProcessType " >

<input type="hidden" name="TransType" >

<input type="hidden" name="UserName " >

<input type="hidden" name="Amount" >

<input type="hidden" name="TransNum" >

<input type="hidden" name="ReturnURL" >

<input type="hidden" name="PageTitle" >

<input type="hidden" name="HasHeader" >

<input type="hidden" name="NameOnCheck " >

<input type="hidden" name="Address" >

<input type="hidden" name="City" >

<input type="hidden" name="State" >

<input type="hidden" name="Zip" >

<input type="hidden" name="ContactPhone" >

<input type="hidden" name="TxnsTitle" >

<input type="hidden" name="TxnsNumCaption" >

<input type="hidden" name="TxnsAmountCaption" >

<input type="hidden" name="CONFeeCaption" >

<input type="hidden" name="TotalAmountCaption" >

<input type="hidden" name="FinishButtonCaption" >

<input type="hidden" name="TotalAttempts" >

<input type="hidden" name="UsedAttempts" >

<input type="hidden" name="PromptCancel" >

<input type="hidden" name="ShowTransNo" >

<input type="hidden" name=" InvocieNo" >

<input type="hidden" name=" PONum" >

<input type="hidden" name=" IsQuickCheckout" >

<input type="hidden" name="CustomerFirstName" >

<input type="hidden" name="CustomerLastName" >

<input type="hidden" name="CustomerStreet2" >

<input type="hidden" name="Customer Street3" >

<input type="hidden" name="CustomerEmail" >

<input type="hidden" name="CustomerDayPhone" >

<input type="hidden" name="CustomerNightPhone" >

<input type="hidden" name=" CustomerMobile" >

<input type="hidden" name=" CustomerFax" >

<input type="hidden" name=" CustomerProvince" >

<input type="hidden" name=" CustomerCountryID" >

<input type="submit" value="submit" name=" submit ">

</form>

(c) Process GSB Card

<form method="POST" action="http://localhost/PaymentMain.aspx ">

<input type="hidden" name="ClientSessionID" >

<input type="hidden" name="ProcessType" >

<input type="hidden" name="TransType" >

<input type="hidden" name="UserName" >

<input type="hidden" name="Amount" >

<input type="hidden" name="TransNum" >

<input type="hidden" name="ReturnURL" >

<input type="hidden" name="PageTitle" >

<input type="hidden" name="HasHeader" >

<input type="hidden" name="FirstName" >

<input type="hidden" name="LastName" >

<input type="hidden" name="Address" >

<input type="hidden" name="City" >

<input type="hidden" name="State" >

<input type="hidden" name="Zip" >

<input type="hidden" name="TxnsTitle" >

<input type="hidden" name="TxnsNumCaption" >

<input type="hidden" name="TxnsAmountCaption" >

<input type="hidden" name="CONFeeCaption" >

<input type="hidden" name="TotalAmountCaption" >

<input type="hidden" name="FinishButtonCaption" >

<input type="hidden" name="TotalAttempts" >

<input type="hidden" name="UsedAttempts" >

<input type="hidden" name="PromptCancel" >

<input type="hidden" name="ShowTransNo" >

<input type="hidden" name="CanSaveCard" >

<input type="hidden" name="CustonerID" >

<input type="hidden" name=" CustonerName" >

<input type="hidden" name=" InvocieNo" >

<input type="hidden" name=" PONum" >

<input type="hidden" name=" IsQuickCheckout" >

<input type="hidden" name="CustomerFirstName" >

<input type="hidden" name="CustomerLastName" >

<input type="hidden" name="CustomerStreet2" >

<input type="hidden" name="Customer Street3" >

<input type="hidden" name="CustomerEmail" >

<input type="hidden" name="CustomerDayPhone" >

<input type="hidden" name="CustomerNightPhone" >

<input type="hidden" name=" CustomerMobile" >

<input type="hidden" name=" CustomerFax" >

<input type="hidden" name=" CustomerProvince" >

<input type="hidden" name=" CustomerCountryID" >

<input type="hidden" name=" TaxAmount" >

<input type="submit" value="submit" name=" submit ">

</form>

The text “localhost” in the URL should be replaced with the actual host name or static IP address of the web portal server.

(2) When the web portal finished the transaction and redirect to the return URL of customer website, you can get the result information from the request. You can write code like this (The example code is ASP.net server site code):

String strClientSessionID = Request.Params["ClientSessionID"].ToString();

String strTransNum = Request.Params["TransNum"].ToString();

String strResultNum = Request.Params["ResultNum"].ToString();

String strAuthorizationCode = Request.Params["AuthorizationCode"].ToString();

String strReferenceNumber = Request.Params["ReferenceNumber"].ToString();

String strUsedAttempts = Request.Params["UsedAttempts"].ToString();



Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

My Blog : Click Here