Specification » History » Version 19
Soh Keong, 11/25/2020 02:50 PM
1 | 19 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | 1 | Soh Keong | h1. Specification |
4 | |||
5 | 5 | Soh Keong | h1. Activity Diagram |
6 | !MOLPay.png! |
||
7 | |||
8 | 1 | Soh Keong | h1. Programming Guide |
9 | |||
10 | 18 | Soh Keong | h3. Jar version |
11 | 1 | Soh Keong | |
12 | 18 | Soh Keong | |_. version |_. Description | |
13 | | 1.0 | Init | |
||
14 | 1 | Soh Keong | |
15 | 12 | Soh Keong | h3. Jar File Download |
16 | |||
17 | 18 | Soh Keong | "Jar":/redmine/attachments/download/409/mol-1.0-SNAPSHOT.jar |
18 | 12 | Soh Keong | |
19 | 1 | Soh Keong | h3. Classes |
20 | |||
21 | * *com.ecosway.mol.common* - CommonConstants, CommonProperties |
||
22 | * *com.ecosway.mol.dao* - MOLInterface |
||
23 | * *com.ecosway.mol.model* - CommonMOL, PaymentMOL, ResponseMOL |
||
24 | * *com.ecosway.mol.service* - MOLService |
||
25 | * *com.ecosway.mol.service.impl* - MOLServiceImpl |
||
26 | * *com.ecosway.mol.utils* - HashUtils |
||
27 | |||
28 | h3. properties file |
||
29 | |||
30 | * *mol.properties* |
||
31 | |||
32 | # *merchant.id* - Merchant login name given by MOLPay |
||
33 | # *payment.url* - Front-end payment page URL |
||
34 | # *verification.code* - Verify Key provided by MOLPay to merchant. |
||
35 | 2 | Soh Keong | |
36 | h3. Database Table |
||
37 | |||
38 | <pre> |
||
39 | 17 | Soh Keong | CREATE TABLE MOL_INTERFACE ( |
40 | 2 | Soh Keong | ORDER_ID VARCHAR(15) NOT NULL, |
41 | TRX_TYPE VARCHAR(5), |
||
42 | SHOPPER_REF_NO INTEGER, |
||
43 | CURRENCY VARCHAR(3), |
||
44 | CHARGE_AMT DECIMAL(15,2), |
||
45 | 15 | Soh Keong | PAYMENT_METHOD VARCHAR(15), |
46 | 2 | Soh Keong | APP_CODE VARCHAR(20), |
47 | TRAN_ID INTEGER, |
||
48 | STATUS VARCHAR(2), |
||
49 | ERROR_CODE VARCHAR(20), |
||
50 | ERROR_DESC VARCHAR(100), |
||
51 | IS_VALID CHARACTER NOT NULL, |
||
52 | PAY_DATE TIMESTAMP, |
||
53 | CREATE_DATETIME TIMESTAMP NOT NULL, |
||
54 | MODIFY_DATETIME TIMESTAMP, |
||
55 | PRIMARY KEY (ORDER_ID)); |
||
56 | </pre> |
||
57 | 3 | Soh Keong | |
58 | *Get MOLPay URL* |
||
59 | |||
60 | <pre> |
||
61 | com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl(); |
||
62 | |||
63 | 1 | Soh Keong | String URL = service.getURL(Connection conn, PaymentMOL payment); |
64 | 17 | Soh Keong | String URL = service.getURL(Connection conn, PaymentMOL payment, String propertiesFileName); |
65 | 3 | Soh Keong | |
66 | 4 | Soh Keong | </pre> |
67 | |||
68 | 3 | Soh Keong | # *conn* - Database connection. |
69 | # *payment* - PaymentMOL object. |
||
70 | > * *orderId* - Order ID. |
||
71 | 9 | Soh Keong | > * *amount* - Transaction amount. (Must greater than 1) |
72 | 3 | Soh Keong | > * *currency* - Currency. (Max 3 characters) |
73 | > * *name* - Shopper Name. |
||
74 | > * *email* - Shopper Email. |
||
75 | > * *mobile* - Shopper Mobile. |
||
76 | > * *description* - Transaction description. |
||
77 | > * *trxType* - Transaction Type. |
||
78 | 8 | Soh Keong | > * *country* - Shopper country. Two letter ISO-3166 country code. (http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html) |
79 | 3 | Soh Keong | > * *shopperRefNo* - Shopper Reference Number. |
80 | > * *returnURL* - Page to be return after transaction. |
||
81 | 15 | Soh Keong | > * *paymentMethod* - Identity which payment method to process the payment. (example : credit card or fpx) |
82 | 4 | Soh Keong | |
83 | 3 | Soh Keong | |
84 | 6 | Soh Keong | *Update MOLPay Response into Database* |
85 | 3 | Soh Keong | |
86 | <pre> |
||
87 | 16 | Soh Keong | com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl(); |
88 | 1 | Soh Keong | com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request) |
89 | 17 | Soh Keong | com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request, String propertiesFileName) |
90 | 3 | Soh Keong | </pre> |
91 | 10 | Soh Keong | |
92 | # *ResponseMOL* |
||
93 | > * orderId - String |
||
94 | > * amount - double |
||
95 | > * tranId - int |
||
96 | > * status - String |
||
97 | > * errorCode - String |
||
98 | > * errorDesc - String |
||
99 | > * currency - String |
||
100 | > * payDate - Date |
||
101 | 11 | Soh Keong | > * valid - boolean |