All pastes #364847 Raw Edit

Mine

public text v1 · immutable
#364847 ·published 2007-02-20 13:07 UTC
rendered paste body
<!--
This is a demo program to demonstrate of the process
of Online Burgan Bank Payment Gateway Transactions.
-->

<%@ page language="java" session="true" %>
<%@ page import="e24PaymentPipe" %>

<%

e24PaymentPipe pipe = new e24PaymentPipe(); // Create an instance of the class
pipe.setAction( "1" ); // Action code, Initialization
pipe.setCurrency( "414" ); // Currency, KD
pipe.setLanguage( "USA" ); // Language, USA
pipe.setTrackId( "123456" ); // Merchant Track ID
pipe.setResponseURL( "www.merchantdemo.com.kw/MerchantDemo/servlet/NotifyServlet" ); // Merchant Response Notification URL
pipe.setErrorURL( "www.merchantdemo.com.kw/MerchantDemo/error.jsp" ); // Merchant Error URL
pipe.setAmt( "10.000" ); // Transaction Amount, calculated at checkout
pipe.setResourcePath( "C:\resourcedir\"); // Directory to your resource.cgn ending with \, if Linux or Unix: pipe.setResourcePath("/etc/resourcedir/");
pipe.setAlias( "MerchantAlias" ); // Alias of the plug-in
pipe.setUdf1( "User Defined Data" ); // User Defined Field

// Send the Payment Initialization message
	if(pipe.performPaymentInitialization() != pipe.SUCCESS) {
   		System.out.println("Error sending Payment Initialization Request: ");
	   	System.out.println(pipe.getDebugMsg());
    
// Redirect Merchant To Error URL
	response.sendRedirect( response.encodeRedirectURL("error.jsp") );
	return;
}

System.out.println(" PaymentInit Sent and Response Received.");

// Get results
	String payID = pipe.getPaymentId();
	String payURL = pipe.getPaymentPage();


//////////////////////////////////////////////////////////////////
                        Customized By Merchant
//////////////////////////////////////////////////////////////////

// Store Transaction data. Most probably this will be in database.
// Merchant will need these data to compare the response he gets with
// the request he sent. Sample of the data to include is provided below:

// Payment ID - Sent back from e24PaymentPipe (required)
// Amount     - Sent from merchant to e24PaymentPipe (required)
// Merchant Tracking ID - Sent from merchant to e24PaymentPipe. (required)
// Transaction Date     - Date of transaction. Not related to Burgan Bank payment page.
// Customer Personal Information, like name, email, address, country, postal code... etc.

//////////////////////////////////////////////////////////////////


// If inserting transaction data in DB fails, don't proceed with transaction
	response.sendRedirect( response.encodeRedirectURL("error.jsp") );
	return;

// If insert into DB succeeded. Redirect customer to Burgan Bank Payment Page
	response.sendRedirect( payURL + "?PaymentID=" + payID );  Redirects user to Burgan Bank Payment Page with parameter PaymentID
%>