3. Processing Methods
3.6 Overview of SENTRY Redirect Link
To implement the Redirect Link method, a developer would need to create an HTML form that would post all of the information needed to process a transaction to the system. The fields contained in the posted form would be all of the information necessary to process a transaction, minus the card detail fields.
Once the gateway server receives all of the transaction information, the transaction is processed. Once the transaction is processed, an HTTPS form POST is sent to the MerRespURL specified, along with the results of the transaction. The receiving script or program at the merchant side listens for the results at the specified MerRespURL, and then decides what type of response to display to the cardholder‟s browser.
3.6.1 Example - Minimum Requirements for Redirect Link
The following are the minimum requirements for an ADC Relay Response transaction. It assumes the merchant is using the generic Payment Form defined by the SENTRY provider. If the merchant does not wish to use the generic payment form, the merchant would then need to customize the Checkout page
PurchaseAmt Purchase Amount as calculated by the merchant‟s checkout system
PurchaseCurrency The currency value of the purchase in ISO Numeric value.
Only values permitted by acquirer are allowed.
PurchaseCurrencyExponent The number of decimal digits of the purchase currency.
OrderID The transaction ID of the order that uniquely identifies the transaction in the merchant‟s system.
Signature The hash signature for the order request
The following code sample is written in VB.NET. It prepares a String containing all the necessary HTML code to place an order request: it contains the mandatory Redirect fields and their values, along with a Javascript function that submits the HTML form to the SENTRY PG listener URL (in the sample, the URL comes from a textbox located on the webpage).
The string containing the HTML form and javascript is then written directly to the output stream of a .NET HttpResponse object and is flushed to the browser, which then executes the javascript and submits the HTML form to SENTRY PG for processing.
NOTE: The limitation of this approach is that if browser has disabled javascript, this code will not function properly. It is assumed that the merchant developer is aware of the appropriate coding approach to use.
CONFIDENTIAL AND PROPRIETARY © 2013, Total System Services, Inc. All rights reserved worldwide. Total System Services, Inc.® and TSYS are federally registered service marks of Total System Services, Inc., in the United States. Total System Services, Inc., owns a number of service marks that are registered in the United States and in other countries. All other products and company names are trademarks or registered trademarks of their respective companies.
Page 35 of 72 Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send.Click
Dim ReqString As String = Nothing
Dim PurcAmount As String = GetAmtFillZeros(PurchaseAmount.Text.Trim) Dim GOrderId As String = GenerateOrderId()
' Calculate the Hash with SHA ...
Dim MerchantHash As String
MerchantHash = MerchantPassword.Text.Trim & MerchantId.Text.Trim & AcquiredId.Text.Trim & GOrderId.Trim & PurcAmount.Trim &
PurchaseCurrency.Text.Trim
Dim Signature = Me.ComputeHash(MerchantHash)
ReqString = "<HTML><body><form id='FrmHtmlCheckout' name='FrmHtmlCheckout' action='' method='post'>" & vbNewLine ReqString &= "<input id='Version' type='hidden' name='Version' value='" & Version.Text.Trim & "'> " & vbNewLine ReqString &= "<input id='MerID' type='hidden' value='" & MerchantId.Text.Trim & "' name='MerID' > " & vbNewLine ReqString &= "<input id='AcqID' type='hidden' value='" & AcquiredId.Text.Trim & "' name='AcqID' > " & vbNewLine
ReqString &= "<input id='MerRespURL' type='hidden' value='" & MerRespUrl.Text.Trim & "' name='MerRespURL'> " & vbNewLine ReqString &= "<input id='PurchaseAmt' type='hidden' value='" & PurcAmount.Trim & "' name='PurchaseAmt'> " & vbNewLine
ReqString &= "<input id='PurchaseCurrency' type='hidden' value='" & PurchaseCurrency.Text.Trim & "' name='PurchaseCurrency'>
" & vbNewLine
ReqString &= "<input id='PurchaseCurrencyExponent' type='hidden' value='" & PurchaseCurrencyExponent.Text.Trim & "' name='PurchaseCurrencyExponent'> " & vbNewLine
ReqString &= "<input id='OrderID' type='hidden' value='" & GOrderId.Trim & "' name='OrderID' > " & vbNewLine
ReqString &= "<input id='SignatureMethod' type='hidden' value='" & SignatureMethod.Text.Trim & "' name='SignatureMethod'> "
& vbNewLine
ReqString &= "<input id='Signature' type='hidden' value='" & Signature & "' name='Signature'> " & vbNewLine
ReqString &= "<input id='CaptureFlag' type='hidden' value='" & CaptureFlag.Text.Trim & "' name='CaptureFlag' > " &
vbNewLine
(sample continued on next page)
CONFIDENTIAL AND PROPRIETARY © 2013, Total System Services, Inc. All rights reserved worldwide. Total System Services, Inc.® and TSYS are federally registered service marks of Total System Services, Inc., in the United States. Total System Services, Inc., owns a number of service marks that are registered in the United States and in other countries. All other products and company names are trademarks or registered trademarks of their respective companies.
Page 36 of 72 ReqString &= "</form>" & vbNewLine
ReqString &= "<script language='javascript'> " & vbNewLine ReqString &= " CheckOut(); " & vbNewLine
ReqString &= "function CheckOut(){" & vbNewLine
ReqString &= "document.FrmHtmlCheckout.action = '" & SentryHostUrl.Text.Trim & "';
" & vbNewLine
ReqString &= "document.FrmHtmlCheckout.submit();" & vbNewLine ReqString &= "}</script></body></HTML>" & vbNewLine
Response.Write(ReqString) Response.Close()
End If End Sub
CONFIDENTIAL AND PROPRIETARY © 2013, Total System Services, Inc. All rights reserved worldwide. Total System Services, Inc.® and TSYS are federally registered service marks of Total System Services, Inc., in the United States. Total System Services, Inc., owns a number of service marks that are registered in the United States and in other countries. All other products and company names are trademarks or registered trademarks of their respective companies.
Page 37 of 72