Project

General

Profile

Specification » History » Version 30

Soh Keong, 03/07/2022 11:55 AM

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