- In an internet driven environment, it is imperative for a company to keep its product or business to the forefront of potential customers' minds. The ...
- A successful enterprise is all about constantly reinventing ways to work more efficiently. In today’s techno age, this translates to testing new too...
- The IT industry plays a pivotal role in providing application development solutions and custom software development to a wide range of industries, i...
- Royal Victorian Eye and Ear Hospital, 2010 Atcomm has been contracted to implement a complex IOP glaucoma management tool which will be distribut...
- We are pleased to announce another implementation of a CMS system for a large Melbourne based fitness center - Star Plate Studio. Atcomm has depl...
Ecommerce Integration In Seam Framework
The JBoss Seam framework provides a flexible and powerful platform for developing web applications based on J2EE. Seam integrates different technologies like AJAX, Java Server Faces (JSF), Java Persistence(JPA), Enterprise Java Beans (EJB3), Hibernate etc. It removes the need for any manual plumbing of these technologies required to build J2EE web applications. Further, with JSF emerging as a standard for the presentation layer in J2EE the developers can leverage this with the server side strength of EJB3 technology. Preference for annotations over xml decreases the development time and improves the team's productivity. They key advantages of seam include :
- Integrate JSF with EJB 3.0
- Integrated AJAX
- Business process as a first class construct
- Declarative state management
- Bijection
- Workspace management and multi-window browsing
- Prefer annotations to XML
- Easy Integration testing
In this article we look at integrating eWAY's e-commerce gateway with a seam application.However, the same methodology can be used with any e-commerce gateway working on a similar concept like eWAY. eWAY offers various modes of linking to their gateway. This article uses the Shared Payment Solution. The shared payment solution takes away the credit card validation and related security concerns from the merchant's site to eWAY itself. The merchant site just needs to 'post' the required information like the customer id and the amount to transact to eWAY. After which the control is transfered to the eWAY site, which displays the form to the user for entering credit card related information. After the transaction the final response is sent back to the merchant site denoting the status and the response message and the control is transfered back to the merchant site. The merchant site can deal with the eway response in its own way e.g. display a confirmation to the user, send emails etc.
The fields required by the eWAY gateway when sending a transaction request include
- ewayCustomerID (required)
- ewayTotalAmount(required)
- ewayCustomerFirstName (Optional)
- ewayCustomerLastName (Optional)
- ewayCustomerEmail (Optional)
- ewayCustomerAddress (Optional)
- ewayCustomerPostcode (Optional)
- ewayCustomerInvoiceDescription
- (Optional) ewayCustomerInvoiceRef
- (Optional)
- ewayURL (Optional)
- ewaySiteTitle (Optional)
- ewayTrxnNumber (Optional)
- eWAYoption1 (Optional)
- eWAYoption2 (Optional)
- eWAYoption3 (Optional)
The fields returned by eway upon transaction include
- ewayTrxnStatus
- ewayTrxnNumber
- eWAYresponseCode
- eWAYresponseText
- ewayTrxnReference
- eWAYoption1
- eWAYoption2
- eWAYoption3
- eWAYAuthCode
- eWAYReturnAmount
In order to integrate a seam application with eWAY we need to create two forms. The first form paymentInfo.xhtml will hold the fields which we need to send to eWAY and the second form captureeWAY.xhtml to capture the data that is sent by eWAY upon transaction completion. The paymentInfo.xhtml will post to the eway gateway url.
paymentInfo.xhtml
The values for the fields are bound to the Payment bean. Also note that we are setting the return url from the eWAY site using the ewayURL field. This is the URL that the control would be returned to once eway finishes the transaction. In order to capture the data sent by the eWAY site we create bound the returned fields to our Payment bean using captureeWAY.xml file.CaptureeWAY.xml

The last element in the xml,