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