Project

General

Profile

Specification » History » Version 9

Soh Keong, 11/26/2012 09:44 AM

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
h3. Classes
15
16
* *com.ecosway.mol.common* - CommonConstants, CommonProperties
17
* *com.ecosway.mol.dao* - MOLInterface
18
* *com.ecosway.mol.model* - CommonMOL, PaymentMOL, ResponseMOL
19
* *com.ecosway.mol.service* - MOLService
20
* *com.ecosway.mol.service.impl* - MOLServiceImpl
21
* *com.ecosway.mol.utils* - HashUtils
22
23
h3. properties file
24
25
* *mol.properties*
26
27
# *merchant.id*       - Merchant login name given by MOLPay
28
# *payment.url*       - Front-end payment page URL
29
# *verification.code* - Verify Key provided by MOLPay to merchant.
30 2 Soh Keong
31
h3. Database Table
32
33
<pre>
34
CREATE TABLE ECOS.MOL_INTERFACE (
35
	ORDER_ID VARCHAR(15) NOT NULL, 
36
	TRX_TYPE VARCHAR(5),
37
	SHOPPER_REF_NO INTEGER,
38
	CURRENCY VARCHAR(3),
39
	CHARGE_AMT DECIMAL(15,2), 
40
	APP_CODE VARCHAR(20), 
41
	TRAN_ID INTEGER, 
42
	STATUS VARCHAR(2), 
43
	ERROR_CODE VARCHAR(20),
44
	ERROR_DESC VARCHAR(100),
45
	IS_VALID CHARACTER NOT NULL, 
46
	PAY_DATE TIMESTAMP,
47
	CREATE_DATETIME TIMESTAMP NOT NULL,
48
	MODIFY_DATETIME TIMESTAMP, 
49
	PRIMARY KEY (ORDER_ID));
50
</pre>
51 3 Soh Keong
52
*Get MOLPay URL*
53
54
<pre>
55
com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();
56
57
String URL = service.getURL(Connection conn, PaymentMOL payment);
58
59 4 Soh Keong
</pre>
60
61 3 Soh Keong
# *conn*           - Database connection.
62
# *payment*        - PaymentMOL object.
63
> * *orderId*      - Order ID.
64 9 Soh Keong
> * *amount*       - Transaction amount. (Must greater than 1)
65 3 Soh Keong
> * *currency*     - Currency. (Max 3 characters)
66
> * *name*         - Shopper Name.
67
> * *email*        - Shopper Email.
68
> * *mobile*       - Shopper Mobile.
69
> * *description*  - Transaction description.
70
> * *trxType*      - Transaction Type.
71 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)
72 3 Soh Keong
> * *shopperRefNo* - Shopper Reference Number.
73
> * *returnURL*    - Page to be return after transaction.
74 4 Soh Keong
75 3 Soh Keong
76 6 Soh Keong
*Update MOLPay Response into Database*
77 3 Soh Keong
78
<pre>
79
com.ecosway.mol.model.ResponseMOL res = new com.ecosway.mol.service.impl.MOLServiceImpl().updateTransaction(Connection conn,
80
			HttpServletRequest request)
81
</pre>