Project

General

Profile

Specification » History » Revision 13

Revision 12 (chin-yeh, 10/25/2010 04:14 PM) → Revision 13/14 (chin-yeh, 11/01/2010 03:31 PM)

{{toc}} 

 h1. Specification 

 The chosen integration method is *HTML Link Method*. By using this method, the customer(consumer) enters her/his credit card information through MAXCONNECT's payment form. Once the payment is processed by MAXCONNECT, the customer will be redirected back to merchant site either through <code>Kick System</code> or <code>Return Button</code>. 

 See attachment:diagram.pdf for the high level view of the payment flow. 

 h2. Java Package Name 

 The package name is  
 <pre>my.com.eCosway.maxconnect</pre> 

 h2. Table(s) used 

 The payment result will be updated to the following table(s): 
 <pre>ECOS.MAXCONNECT_INTERFACE</pre> 

 h2. Integration Guide 

 MAXCONNECT returns the payment result via *RETURN* button and *KICK System*. For security concern, any updates on order status *should be* done on the *KICK system*, which is a server-to-server calls (via HTTP GET method). 

 See attachment:diagram.pdf for the high level view of the payment flow. 

 h3. RETURN url and KICK url 

 *Production:* 
 <pre> 
 Site ID: 21400201 
 Site Password: ARn7Nez8 
 Currency: NZD (New Zealand Dollar) 
 </pre> 

 *Development*: 
 <pre> 
 Site ID: 21400204 
 Site Password: 7zVZS4iE 
 Currency: NZD (New Zealand Dollar) 

 RETURN URL: http://60.49.152.21/nzstore/nz/mc_back_url_nz.jsp   	
 KICK URL: http://60.49.152.21/nzstore/nz/mc_kick_callback_nz.jsp 
 </pre> 

 h3. Programming Guide 

 * *Generate the data required for MAXCONNECT's payment form* 
 There is an utility to populate all of the required fields for the MAXCONNECT payment form. One could use the utility to customize the presentation of the HTML form. Sample code: 
 <pre> 
 <% 
	 final String orderId = "test ID 123"; 
	 final BigDecimal amount = new BigDecimal("88.34"); 
	 final String redirectUrl = "http://google.com"; 
	 final Commons.Locale language = Commons.Locale.CHINESE; 

	 PaymentFormBean formBean = PaymentUtils.generatePaymentFormBean(orderId,  
			 amount, redirectUrl, language); 

 %> 
 <form name="paymentFrm" method="<%=formBean.getFormMethod()%>" action="<%=formBean.getFormActionUrl() %>"> 
	
	
	 <% 
		 // iterate over the input items 	
		 final String inputTemplate = "<input type=\"hidden\" name=\"%1$s\" value=\"%2$s\""; 
		 for (Map.Entry<String, String> item : formBean.getFormElement().entrySet()) { 
			 out.print(String.format(inputTemplate, item.getKey(), item.getValue())); 
		 } 
	 %> 

	 <input type="submit" value="Submit"/> 
 </form> 

 full source code can be found in : nz/sample/maxconnect_payment_form.jsp 
 </pre> 
 ** *orderId* - the unique ID of the order 
 ** *amount* - the settlement amount 
 ** *redirectUrl* - this parameter will be returned by MAXCONNECT. One could use this to do the page redirection 
 ** *language* - the language to be used in the MAXCONNECT payment form 
 * *How to redirect page* 
 see *nz/mc_back_url_nz.jsp* for sample usage 
 * *Queries the payment result* 
 Query the field, <code>is_valid</code> in the <code>ECOS.MAXCONNECT_INTERFACE</code> table. 'Y' means success else 'N'