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