The Relay Response sample code below shows how the merchant could respond upon receiving the transaction results from First Data Payeezy Gateway. In this Ruby on Rails example, the developer would change each merchant.com placeholder URL to the merchant's absolute URL equivalent.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Receipt</title>
<script type="text/javascript" src="http://merchant.com/javascript.js" ></script>
<link rel="stylesheet" href="http://merchant.com/style.css" type="text/css" />
</head>
<body>
<h1>Merchant.com Online Store</h1>
<h2><%= h params[:x_response_reason_text]%></h2>
<% if params[:x_response_code] == '1' %>
<h2>Order Paid</h2>
<p>
Your payment was processed successfully.
Your order will be shipped in two business days.
Here is your receipt.
</p>
<pre>
<%= h params[:exact_ctr]%>
</pre>
<% end %>
<p>
<% track_url = url_for(:controller=>'orders', :action=>'track', :order_id => params[:x_invoice_num], :only_path=>false %>
You can track it at <%= link_to track_url, track_url %>
</p>
<% end %>
<% if params[:x_response_code] == '2' %>
<p>
Your payment failed.
Here is your receipt.
</p>
<pre>
<%= h params[:exact_ctr]%>
</pre>
<% end %>
<% if params[:x_response_code] == '3' %>
<p>
An error occurred while processing your payment.
Please try again later.
</p>
<% end %>
<p>
Return to <a href="http://merchant.com/home">home</a>.
</p>
</body>
</html>
The Relay Response sample code below shows how the merchant could respond upon receiving the transaction results from Payeezy Gateway. In this JSP example, the developer would change each merchant.com placeholder URL to the merchant's absolute URL equivalent.
<%@ page language="java" import="java.lang.*" %>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Receipt</title>
<script type="text/javascript" src="http://merchant.com/javascript.js" ></script>
<link rel="stylesheet" href="http://merchant.com/style.css" type="text/css" />
</head>
<body>
<h1>Merchant.com Online Store</h1>
<h2><%=request.getParameter("x_response_reason_text")%></h2>
<% if(request.getParameter("x_response_code") == '1') { %>
<p>
Your payment was processed successfully.
Your order will be shipped in two business days.
Here is your receipt.
</p>
<pre>
<%=request.getParameter("exact_ctr")%>
</pre>
<% if(request.getParameter("exact_issname") != null) { %>
<p>
Issuer: <%=request.getParameter("exact_issname")%><br/>
Confirmation Number: <%=request.getParameter("exact_issconf")%>
</p>
<% } %>
<p>
<% String track_url = "http://merchant.com/order_tracking/" + request.getParameter("x_invoice_num"); %>
You can track it at <a href="<%= track_url%>"><%= track_url %></a>.
</p>
<% } %>
<% if(request.getParameter("x_response_code") == '2') { %>
<p>
Your payment failed.
Here is your receipt.
</p>
<pre>
<%=request.getParameter("exact_ctr")%>
</pre>
<% } %>
<% if(request.getParameter("x_response_code") == '3') { %>
<p>
An error occurred while processing your payment.
Please try again later.
</p>
<% } %>
<p>
Return to <a href="http://merchant.com/home">home</a>.
</p>
</body>
</html>
The Relay Response sample code below shows how the merchant could respond upon receiving the transaction results from Payeezy Gateway. In this PHP example, the developer would change each merchant.com placeholder URL to the merchant's absolute URL equivalent.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Receipt</title>
<script type="text/javascript" src="http://merchant.com/javascript.js" ></script>
<link rel="stylesheet" href="http://merchant.com/style.css" type="text/css" />
</head>
<body>
<h1>Merchant.com Online Store</h1>
<h2>
<?php echo $_REQUEST['x_response_reason_text'] ?>
</h2>
<?php
if ($_REQUEST['x_response_code'] == '1') {
echo "<p>";
echo "Your order was processed successfully. Here is your receipt.";
echo "Your order will be shipped in two business days.";
echo "</p>";
echo "<pre>";
echo $_REQUEST["exact_ctr"];
echo "</pre>";
if (!empty($_REQUEST["exact_issname"])) {
echo "<p>";
echo "Issuer: " .$_REQUEST["exact_issname"] . "<br/>";
echo "Confirmation Number: " . $_REQUEST["exact_issconf"];
echo "</p>";
}
echo "<p>";
$track_url = "http://merchant.com/order_tracking/" . $_REQUEST["x_invoice_num"];
echo "You can track it at <a href=\"" . $track_url . "\">" .
$track_url . "</a>";
echo "</p>";
} elseif ($_REQUEST['x_response_code'] == '2') {
echo "<p>";
echo "Your payment failed.";
echo "Here is your receipt.";
echo "</p>";
echo "<pre>";
echo $_REQUEST["exact_ctr"];
echo "</pre>";
} else {
echo "<p>";
echo "An error occurred while processing your payment.";
echo "Please try again later.";
echo "</p>";
}
?>
</body>
</html>
The Relay Response sample code below shows how the merchant could respond upon receiving the transaction results from Payeezy Gateway. In this ASP example, the developer would change each merchant.com placeholder URL to the merchant's absolute URL equivalent.
<% Response.Expires = 0
Dim ResponseCode
Dim TrackUrl
' Process Post parameters
ResponseCode = Trim(Request.Form("x_response_code"))
%>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Receipt</title>
<script type="text/javascript" src="http://merchant.com/javascript.js" ></script>
<link rel="stylesheet" href="http://merchant.com/style.css" type="text/css" />
</head>
<body>
<h1>Merchant.com Online Store</h1>
<h2> <%= Request.Form('x_response_reason_text') %></h2>
<%
Select Case ResponseCode
Case "1" %>
<p>
Your order was processed successfully. Here is your receipt.
Your order will be shipped in two business days.
</p>
<pre>
<%= Request.Form("exact_ctr")%>
</pre>
<% If not(isNull(Request.Form("exact_issname"))) Then %>
<p>
Issuer: <%= Request.Form("exact_issname")%><br/>
Confirmation Number: <%= Request.Form("exact_issconf")%>
</p>
<% End If %>
<p>
<% TrackUrl = "http://merchant.com/order_tracking/" & Request.Form("x_invoice_num") %>
You can track it at <%= TrackUrl %></a>.
</p>
<% Case "2" %>
<p>
Your payment failed.
Here is your receipt.
</p>
<pre>
<%= Request.Form("exact_ctr") %>
</pre>
<% Case Else %>
<p>
An error occurred while processing your payment.
Please try again later.
</p>
<% End Select %>
</body>
</html>