Project

General

Profile

Specification » History » Version 9

chin-yeh, 10/25/2010 09:09 AM

1 2 chin-yeh
{{toc}}
2
3 1 chin-yeh
h1. Specification
4
5
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>.
6 2 chin-yeh
7 5 chin-yeh
See attachment:diagram.pdf for the high level view of the payment flow.
8 4 chin-yeh
9 2 chin-yeh
h2. Java Package Name
10
11
The package name is 
12 6 chin-yeh
<pre>my.com.eCosway.maxconnect</pre>
13 2 chin-yeh
14 7 chin-yeh
h2. Integration Guide
15 1 chin-yeh
16 7 chin-yeh
MAXCONNECT returns the payment result via *RETURN* button and *KICK System*. For security concern, the order update will only be done on the *KICK system*, which is a server-to-server calls (via HTTP GET method).
17 1 chin-yeh
18 7 chin-yeh
See attachment:diagram.pdf for the high level view of the payment flow.
19 1 chin-yeh
20 7 chin-yeh
h3. RETURN URL and KICK URL
21 1 chin-yeh
22 7 chin-yeh
Site ID: 21400201
23
Site Password: ARn7Nez8
24 9 chin-yeh
Currency: NZD (New Zealand Dollar)
25 1 chin-yeh
<pre>
26 7 chin-yeh
RETURN URL: http://219.94.77.229/nzstore/nz/mc_back_url_nz.jsp  	
27
KICK URL: http://219.94.77.229/nzstore/nz/mc_kick_callback_nz.jsp
28 1 chin-yeh
</pre>
29
30 7 chin-yeh
h3. Programming Guide
31
32
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:
33 1 chin-yeh
<pre>
34 7 chin-yeh
<%
35
	final String orderId = "test ID 123";
36
	final BigDecimal amount = new BigDecimal("88.34");
37
	final String redirectUrl = "http://google.com";
38
	final Commons.Locale language = Commons.Locale.CHINESE;
39 1 chin-yeh
40 7 chin-yeh
	PaymentFormBean formBean = PaymentUtils.generatePaymentFormBean(orderId, 
41
			amount, redirectUrl, language);
42 3 chin-yeh
43 7 chin-yeh
%>
44
<form name="paymentFrm" method="<%=formBean.getFormMethod()%>" action="<%=formBean.getFormActionUrl() %>">
45
	
46
	
47
	<%
48
		// iterate over the input items	
49
		final String inputTemplate = "<input type=\"hidden\" name=\"%1$s\" value=\"%2$s\"";
50
		for (Map.Entry<String, String> item : formBean.getFormElement().entrySet()) {
51
			out.print(String.format(inputTemplate, item.getKey(), item.getValue()));
52
		}
53
	%>
54 3 chin-yeh
55 7 chin-yeh
	<input type="submit" value="Submit"/>
56
</form>
57
58 8 chin-yeh
full source code can be found in : nz/sample/maxconnect_payment_form.jsp
59 3 chin-yeh
</pre>
60 7 chin-yeh
* *orderId* - the unique ID of the order
61
* *amount* - the settlement amount
62
* *redirectUrl* - this parameter will be returned by MAXCONNECT. One could use this to do the page redirection
63
* *language* - the language to be used in the MAXCONNECT payment form
64
65
The payment result will be captured via *KICK* URL so that you can query the result based on the <code>orderId</code>.