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