Project

General

Profile

Specification » History » Version 31

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