Project

General

Profile

Specification » History » Version 15

Soh Keong, 12/05/2012 09:19 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 12 Soh Keong
h3. Jar File Download
15
16 14 Soh Keong
"Download Page":http://192.168.2.13:50000/redmine/projects/pay/files
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 15 Soh Keong
	PAYMENT_METHOD VARCHAR(15),
45 2 Soh Keong
	APP_CODE VARCHAR(20), 
46
	TRAN_ID INTEGER, 
47
	STATUS VARCHAR(2), 
48
	ERROR_CODE VARCHAR(20),
49
	ERROR_DESC VARCHAR(100),
50
	IS_VALID CHARACTER NOT NULL, 
51
	PAY_DATE TIMESTAMP,
52
	CREATE_DATETIME TIMESTAMP NOT NULL,
53
	MODIFY_DATETIME TIMESTAMP, 
54
	PRIMARY KEY (ORDER_ID));
55
</pre>
56 3 Soh Keong
57
*Get MOLPay URL*
58
59
<pre>
60
com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl();
61
62
String URL = service.getURL(Connection conn, PaymentMOL payment);
63
64 4 Soh Keong
</pre>
65
66 3 Soh Keong
# *conn*           - Database connection.
67
# *payment*        - PaymentMOL object.
68
> * *orderId*      - Order ID.
69 9 Soh Keong
> * *amount*       - Transaction amount. (Must greater than 1)
70 3 Soh Keong
> * *currency*     - Currency. (Max 3 characters)
71
> * *name*         - Shopper Name.
72
> * *email*        - Shopper Email.
73
> * *mobile*       - Shopper Mobile.
74
> * *description*  - Transaction description.
75
> * *trxType*      - Transaction Type.
76 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)
77 3 Soh Keong
> * *shopperRefNo* - Shopper Reference Number.
78
> * *returnURL*    - Page to be return after transaction.
79 15 Soh Keong
> * *paymentMethod* - Identity which payment method to process the payment. (example : credit card or fpx)
80 4 Soh Keong
81 3 Soh Keong
82 6 Soh Keong
*Update MOLPay Response into Database*
83 3 Soh Keong
84
<pre>
85
com.ecosway.mol.model.ResponseMOL res = new com.ecosway.mol.service.impl.MOLServiceImpl().updateTransaction(Connection conn,
86
			HttpServletRequest request)
87
</pre>
88 10 Soh Keong
89
# *ResponseMOL*
90
> * orderId - String
91
> * amount - double
92
> * tranId - int
93
> * status - String
94
> * errorCode - String
95
> * errorDesc - String
96
> * currency - String
97
> * payDate - Date
98 11 Soh Keong
> * valid - boolean