Project

General

Profile

Specification » History » Version 38

Soh Keong, 05/03/2024 02:33 PM

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