Specification » History » Version 13
chin-yeh, 11/01/2010 03:31 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 | 12 | chin-yeh | 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). |
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 | 13 | chin-yeh | *Production:* |
28 | <pre> |
||
29 | 7 | chin-yeh | Site ID: 21400201 |
30 | 1 | chin-yeh | Site Password: ARn7Nez8 |
31 | 7 | chin-yeh | Currency: NZD (New Zealand Dollar) |
32 | 13 | chin-yeh | </pre> |
33 | 11 | chin-yeh | |
34 | 13 | chin-yeh | *Development*: |
35 | 1 | chin-yeh | <pre> |
36 | 13 | chin-yeh | Site ID: 21400204 |
37 | Site Password: 7zVZS4iE |
||
38 | Currency: NZD (New Zealand Dollar) |
||
39 | |||
40 | 10 | chin-yeh | RETURN URL: http://60.49.152.21/nzstore/nz/mc_back_url_nz.jsp |
41 | KICK URL: http://60.49.152.21/nzstore/nz/mc_kick_callback_nz.jsp |
||
42 | 1 | chin-yeh | </pre> |
43 | |||
44 | h3. Programming Guide |
||
45 | 7 | chin-yeh | |
46 | 11 | chin-yeh | * *Generate the data required for MAXCONNECT's payment form* |
47 | 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: |
48 | 1 | chin-yeh | <pre> |
49 | 7 | chin-yeh | <% |
50 | final String orderId = "test ID 123"; |
||
51 | final BigDecimal amount = new BigDecimal("88.34"); |
||
52 | final String redirectUrl = "http://google.com"; |
||
53 | final Commons.Locale language = Commons.Locale.CHINESE; |
||
54 | 1 | chin-yeh | |
55 | 7 | chin-yeh | PaymentFormBean formBean = PaymentUtils.generatePaymentFormBean(orderId, |
56 | amount, redirectUrl, language); |
||
57 | 3 | chin-yeh | |
58 | 7 | chin-yeh | %> |
59 | <form name="paymentFrm" method="<%=formBean.getFormMethod()%>" action="<%=formBean.getFormActionUrl() %>"> |
||
60 | |||
61 | |||
62 | <% |
||
63 | // iterate over the input items |
||
64 | final String inputTemplate = "<input type=\"hidden\" name=\"%1$s\" value=\"%2$s\""; |
||
65 | for (Map.Entry<String, String> item : formBean.getFormElement().entrySet()) { |
||
66 | out.print(String.format(inputTemplate, item.getKey(), item.getValue())); |
||
67 | 1 | chin-yeh | } |
68 | %> |
||
69 | |||
70 | <input type="submit" value="Submit"/> |
||
71 | </form> |
||
72 | |||
73 | full source code can be found in : nz/sample/maxconnect_payment_form.jsp |
||
74 | </pre> |
||
75 | 11 | chin-yeh | ** *orderId* - the unique ID of the order |
76 | ** *amount* - the settlement amount |
||
77 | ** *redirectUrl* - this parameter will be returned by MAXCONNECT. One could use this to do the page redirection |
||
78 | ** *language* - the language to be used in the MAXCONNECT payment form |
||
79 | * *How to redirect page* |
||
80 | see *nz/mc_back_url_nz.jsp* for sample usage |
||
81 | * *Queries the payment result* |
||
82 | Query the field, <code>is_valid</code> in the <code>ECOS.MAXCONNECT_INTERFACE</code> table. 'Y' means success else 'N' |