Project

General

Profile

Specification » History » Version 22

Soh Keong, 12/08/2020 03:21 PM

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