Project

General

Profile

Specification » History » Version 13

Soh Keong, 11/28/2012 01:25 PM

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