Project

General

Profile

Specification » History » Version 11

chin-yeh, 10/25/2010 04:12 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 11 chin-yeh
h2. Table(s) used
15
16
The payment result will be updated to the following table(s):
17
<pre>ECOS.MAXCONNECT_INTERFACE</pre>
18
19 7 chin-yeh
h2. Integration Guide
20 1 chin-yeh
21 11 chin-yeh
MAXCONNECT returns the payment result via *RETURN* button and *KICK System*. For security concern, the updates on order status *should be* done on the *KICK system*, which is a server-to-server calls (via HTTP GET method).
22 7 chin-yeh
23 1 chin-yeh
See attachment:diagram.pdf for the high level view of the payment flow.
24
25 11 chin-yeh
h3. RETURN url and KICK url
26 1 chin-yeh
27 7 chin-yeh
Site ID: 21400201
28 1 chin-yeh
Site Password: ARn7Nez8
29 7 chin-yeh
Currency: NZD (New Zealand Dollar)
30 11 chin-yeh
31 1 chin-yeh
<pre>
32 10 chin-yeh
RETURN URL: http://60.49.152.21/nzstore/nz/mc_back_url_nz.jsp  	
33
KICK URL: http://60.49.152.21/nzstore/nz/mc_kick_callback_nz.jsp
34 1 chin-yeh
</pre>
35
36
h3. Programming Guide
37 7 chin-yeh
38 11 chin-yeh
* *Generate the data required for MAXCONNECT's payment form*
39 7 chin-yeh
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:
40 1 chin-yeh
<pre>
41 7 chin-yeh
<%
42
	final String orderId = "test ID 123";
43
	final BigDecimal amount = new BigDecimal("88.34");
44
	final String redirectUrl = "http://google.com";
45
	final Commons.Locale language = Commons.Locale.CHINESE;
46 1 chin-yeh
47 7 chin-yeh
	PaymentFormBean formBean = PaymentUtils.generatePaymentFormBean(orderId, 
48
			amount, redirectUrl, language);
49 3 chin-yeh
50 7 chin-yeh
%>
51
<form name="paymentFrm" method="<%=formBean.getFormMethod()%>" action="<%=formBean.getFormActionUrl() %>">
52
	
53
	
54
	<%
55
		// iterate over the input items	
56
		final String inputTemplate = "<input type=\"hidden\" name=\"%1$s\" value=\"%2$s\"";
57
		for (Map.Entry<String, String> item : formBean.getFormElement().entrySet()) {
58
			out.print(String.format(inputTemplate, item.getKey(), item.getValue()));
59 1 chin-yeh
		}
60
	%>
61
62
	<input type="submit" value="Submit"/>
63
</form>
64
65
full source code can be found in : nz/sample/maxconnect_payment_form.jsp
66
</pre>
67 11 chin-yeh
** *orderId* - the unique ID of the order
68
** *amount* - the settlement amount
69
** *redirectUrl* - this parameter will be returned by MAXCONNECT. One could use this to do the page redirection
70
** *language* - the language to be used in the MAXCONNECT payment form
71
* *How to redirect page*
72
see *nz/mc_back_url_nz.jsp* for sample usage
73
* *Queries the payment result*
74
Query the field, <code>is_valid</code> in the <code>ECOS.MAXCONNECT_INTERFACE</code> table. 'Y' means success else 'N'