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