Project

General

Profile

Specification » History » Version 27

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