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