Project

General

Profile

Specification » History » Version 7

chin-yeh, 10/21/2010 08:19 PM

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 1 chin-yeh
<pre>
25 7 chin-yeh
RETURN URL: http://219.94.77.229/nzstore/nz/mc_back_url_nz.jsp  	
26
KICK URL: http://219.94.77.229/nzstore/nz/mc_kick_callback_nz.jsp
27 1 chin-yeh
</pre>
28
29 7 chin-yeh
h3. Programming Guide
30
31
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:
32 1 chin-yeh
<pre>
33 7 chin-yeh
<%
34
	final String orderId = "test ID 123";
35
	final BigDecimal amount = new BigDecimal("88.34");
36
	final String redirectUrl = "http://google.com";
37
	final Commons.Locale language = Commons.Locale.CHINESE;
38 1 chin-yeh
39 7 chin-yeh
	PaymentFormBean formBean = PaymentUtils.generatePaymentFormBean(orderId, 
40
			amount, redirectUrl, language);
41 3 chin-yeh
42 7 chin-yeh
%>
43
<form name="paymentFrm" method="<%=formBean.getFormMethod()%>" action="<%=formBean.getFormActionUrl() %>">
44
	
45
	
46
	<%
47
		// iterate over the input items	
48
		final String inputTemplate = "<input type=\"hidden\" name=\"%1$s\" value=\"%2$s\"";
49
		for (Map.Entry<String, String> item : formBean.getFormElement().entrySet()) {
50
			out.print(String.format(inputTemplate, item.getKey(), item.getValue()));
51
		}
52
	%>
53 3 chin-yeh
54 7 chin-yeh
	<input type="submit" value="Submit"/>
55
</form>
56
57 3 chin-yeh
</pre>
58 7 chin-yeh
* *orderId* - the unique ID of the order
59
* *amount* - the settlement amount
60
* *redirectUrl* - this parameter will be returned by MAXCONNECT. One could use this to do the page redirection
61
* *language* - the language to be used in the MAXCONNECT payment form
62
63
The payment result will be captured via *KICK* URL so that you can query the result based on the <code>orderId</code>.