Project

General

Profile

Specification » History » Version 20

Soh Keong, 11/25/2020 03:00 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 18 Soh Keong
h3. Jar version 
11 1 Soh Keong
12 18 Soh Keong
|_. version |_. Description  |
13
| 1.0       | Init           |
14 1 Soh Keong
15 12 Soh Keong
h3. Jar File Download
16
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
h3. Database Table
38
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
*Get MOLPay URL*
60
61
<pre>
62
com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();
63
64 1 Soh Keong
String URL = service.getURL(Connection conn, PaymentMOL payment);
65 17 Soh Keong
String URL = service.getURL(Connection conn, PaymentMOL payment, String propertiesFileName);
66 3 Soh Keong
67 4 Soh Keong
</pre>
68
69 3 Soh Keong
# *conn*           - Database connection.
70
# *payment*        - PaymentMOL object.
71
> * *orderId*      - Order ID.
72 9 Soh Keong
> * *amount*       - Transaction amount. (Must greater than 1)
73 3 Soh Keong
> * *currency*     - Currency. (Max 3 characters)
74
> * *name*         - Shopper Name.
75
> * *email*        - Shopper Email.
76
> * *mobile*       - Shopper Mobile.
77
> * *description*  - Transaction description.
78
> * *trxType*      - Transaction Type.
79 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)
80 3 Soh Keong
> * *shopperRefNo* - Shopper Reference Number.
81
> * *returnURL*    - Page to be return after transaction.
82 15 Soh Keong
> * *paymentMethod* - Identity which payment method to process the payment. (example : credit card or fpx)
83 4 Soh Keong
84 3 Soh Keong
85 6 Soh Keong
*Update MOLPay Response into Database*
86 3 Soh Keong
87
<pre>
88 16 Soh Keong
com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();
89 1 Soh Keong
com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request)
90 17 Soh Keong
com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request, String propertiesFileName)
91 3 Soh Keong
</pre>
92 10 Soh Keong
93
# *ResponseMOL*
94
> * orderId - String
95
> * amount - double
96
> * tranId - int
97
> * status - String
98
> * errorCode - String
99
> * errorDesc - String
100
> * currency - String
101
> * payDate - Date
102 11 Soh Keong
> * valid - boolean