Project

General

Profile

Specification » History » Version 26

Soh Keong, 01/13/2022 09:28 AM

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