Specification » History » Version 29
Soh Keong, 02/22/2022 02:45 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 | 22 | Soh Keong | h2. Jar version |
11 | 1 | Soh Keong | |
12 | 28 | Soh Keong | |_. version |_. Description | |
13 | | 1.11 | Init | |
||
14 | | 1.13 | Added Monthly Dedcution | |
||
15 | | 2.0 | Added Bank Installment Plan | |
||
16 | | 2.0.1 | Split One Time and Installment account | |
||
17 | 1 | Soh Keong | |
18 | 22 | Soh Keong | h2. Jar File Download |
19 | 12 | Soh Keong | |
20 | 29 | Soh Keong | "Jar":/redmine/attachments/download/635/mol-2.0.1.jar |
21 | 20 | Soh Keong | "Properties":/redmine/attachments/download/523/mol_cosway.properties |
22 | 12 | Soh Keong | |
23 | 1 | Soh Keong | h3. Classes |
24 | |||
25 | * *com.ecosway.mol.common* - CommonConstants, CommonProperties |
||
26 | * *com.ecosway.mol.dao* - MOLInterface |
||
27 | * *com.ecosway.mol.model* - CommonMOL, PaymentMOL, ResponseMOL |
||
28 | * *com.ecosway.mol.service* - MOLService |
||
29 | * *com.ecosway.mol.service.impl* - MOLServiceImpl |
||
30 | * *com.ecosway.mol.utils* - HashUtils |
||
31 | |||
32 | h3. properties file |
||
33 | |||
34 | * *mol.properties* |
||
35 | |||
36 | # *merchant.id* - Merchant login name given by MOLPay |
||
37 | # *payment.url* - Front-end payment page URL |
||
38 | # *verification.code* - Verify Key provided by MOLPay to merchant. |
||
39 | 28 | Soh Keong | # *secret.code* - for encryption purpose. |
40 | 2 | Soh Keong | |
41 | 22 | Soh Keong | h2. Database Table |
42 | 2 | Soh Keong | |
43 | <pre> |
||
44 | 17 | Soh Keong | CREATE TABLE MOL_INTERFACE ( |
45 | 2 | Soh Keong | ORDER_ID VARCHAR(15) NOT NULL, |
46 | TRX_TYPE VARCHAR(5), |
||
47 | SHOPPER_REF_NO INTEGER, |
||
48 | CURRENCY VARCHAR(3), |
||
49 | CHARGE_AMT DECIMAL(15,2), |
||
50 | 15 | Soh Keong | PAYMENT_METHOD VARCHAR(15), |
51 | 2 | Soh Keong | APP_CODE VARCHAR(20), |
52 | TRAN_ID INTEGER, |
||
53 | 1 | Soh Keong | STATUS VARCHAR(2), |
54 | 2 | Soh Keong | ERROR_CODE VARCHAR(20), |
55 | ERROR_DESC VARCHAR(100), |
||
56 | IS_VALID CHARACTER NOT NULL, |
||
57 | PAY_DATE TIMESTAMP, |
||
58 | 28 | Soh Keong | FILE_NAME VARCHAR(50), |
59 | 2 | Soh Keong | CREATE_DATETIME TIMESTAMP NOT NULL, |
60 | MODIFY_DATETIME TIMESTAMP, |
||
61 | PRIMARY KEY (ORDER_ID)); |
||
62 | </pre> |
||
63 | 3 | Soh Keong | |
64 | 22 | Soh Keong | h2. MOL Service |
65 | 21 | Soh Keong | |
66 | 1 | Soh Keong | <pre> |
67 | com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl(); |
||
68 | 22 | Soh Keong | </pre> |
69 | 3 | Soh Keong | |
70 | 22 | Soh Keong | h3. getURL |
71 | |||
72 | <pre> |
||
73 | 17 | Soh Keong | String URL = service.getURL(Connection conn, PaymentMOL payment); |
74 | 3 | Soh Keong | String URL = service.getURL(Connection conn, PaymentMOL payment, String propertiesFileName); |
75 | 4 | Soh Keong | </pre> |
76 | |||
77 | 3 | Soh Keong | # *conn* - Database connection. |
78 | # *payment* - PaymentMOL object. |
||
79 | > * *orderId* - Order ID. |
||
80 | 9 | Soh Keong | > * *amount* - Transaction amount. (Must greater than 1) |
81 | 3 | Soh Keong | > * *currency* - Currency. (Max 3 characters) |
82 | > * *name* - Shopper Name. |
||
83 | > * *email* - Shopper Email. |
||
84 | > * *mobile* - Shopper Mobile. |
||
85 | > * *description* - Transaction description. |
||
86 | > * *trxType* - Transaction Type. |
||
87 | 1 | 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) |
88 | > * *shopperRefNo* - Shopper Reference Number. |
||
89 | 8 | Soh Keong | > * *returnURL* - Page to be return after transaction. |
90 | 24 | Soh Keong | > * *callbackURL* - Page to be return after transaction. |
91 | > * *cancelURL* - Page to be return after transaction. |
||
92 | 26 | Soh Keong | > * *paymentMethod* - Identity which payment method to process the payment. |
93 | - Refer : com.ecosway.mol.common.PaymentInstallmentEnum (name=display name; page=page to redirect; type= Installment or One Time Payment) |
||
94 | 24 | Soh Keong | > * *installmonth* - Number of Installment month. |
95 | 3 | Soh Keong | |
96 | 21 | Soh Keong | |
97 | 3 | Soh Keong | h3. Update MOLPay Response into Database |
98 | |||
99 | 16 | Soh Keong | <pre> |
100 | 1 | Soh Keong | com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request) |
101 | 17 | Soh Keong | com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request, String propertiesFileName) |
102 | 3 | Soh Keong | </pre> |
103 | 10 | Soh Keong | |
104 | # *ResponseMOL* |
||
105 | > * orderId - String |
||
106 | > * amount - double |
||
107 | > * tranId - int |
||
108 | > * status - String |
||
109 | > * errorCode - String |
||
110 | > * errorDesc - String |
||
111 | > * currency - String |
||
112 | > * payDate - Date |
||
113 | 11 | Soh Keong | > * valid - boolean |