Project

General

Profile

Specification » History » Revision 37

Revision 36 (Soh Keong, 11/09/2022 11:36 AM) → Revision 37/39 (Soh Keong, 12/09/2022 04:38 PM)

{{toc}} 

 h1. Specification 

 h1. Activity Diagram 

 !MOLPay.png! 

 h1. Programming Guide 

 h2. Jar version  

 |_. version |_. Description                                                             | 
 | 1.11        | Init                                                                               | 
 | 1.13        | Added Monthly Dedcution                                         | 
 | 2.0         | Added Bank Installment Plan                                 | 
 | 2.0.1       | Split One Time and Installment account         | 
 | 2.1         | Store Installment Bank at DB                               | 
 | 2.2         | Added callback URL                                                   | 
 | 2.2.1       | Fixed properties file when updateTransaction |  

 

 h2. Jar File Download 

 "Jar":http://202.129.164.38:8000/redmine/attachments/download/728/mol-2.2.1.jar "Jar":/redmine/attachments/download/717/mol-2.2.jar 
 "Properties":/redmine/attachments/download/713/mol_cosway.properties 
 "Properties Installment":/redmine/attachments/download/714/mol_cosway_installment.properties 

 h3. Classes 

 * *com.ecosway.mol.common* - CommonConstants, CommonProperties 
 * *com.ecosway.mol.dao* - MOLInterface 
 * *com.ecosway.mol.model* - CommonMOL, PaymentMOL, ResponseMOL 
 * *com.ecosway.mol.service* - MOLService 
 * *com.ecosway.mol.service.impl* - MOLServiceImpl 
 * *com.ecosway.mol.utils* - HashUtils 

 h3. properties file 

 * *mol.properties* 

 # *merchant.id*         - Merchant login name given by MOLPay 
 # *payment.url*         - Front-end payment page URL 
 # *verification.code* - Verify Key provided by MOLPay to merchant. 
 # *secret.code*         - for encryption purpose. 

 h2. Database Table 

 <pre> 
 CREATE TABLE MOL_INTERFACE ( 
	 ORDER_ID VARCHAR(15) NOT NULL,  
	 TRX_TYPE VARCHAR(5), 
	 SHOPPER_REF_NO INTEGER, 
	 CURRENCY VARCHAR(3), 
	 CHARGE_AMT DECIMAL(15,2),  
	 PAYMENT_METHOD VARCHAR(15), 
	 APP_CODE VARCHAR(20),  
	 TRAN_ID INTEGER,  
	 STATUS VARCHAR(2),  
	 ERROR_CODE VARCHAR(20), 
	 ERROR_DESC VARCHAR(100), 
	 IS_VALID CHARACTER NOT NULL,  
	 PAY_DATE TIMESTAMP, 
         FILE_NAME VARCHAR(50), 
	 CREATE_DATETIME TIMESTAMP NOT NULL, 
	 MODIFY_DATETIME TIMESTAMP,  
	 PRIMARY KEY (ORDER_ID)); 
 </pre> 

 h2. MOL Service 

 <pre> 
 com.ecosway.mol.service.MOLService service = new com.ecosway.mol.service.impl.MOLServiceImpl(); 
 </pre> 

 h3. getURL 

 <pre> 
 String URL = service.getURL(Connection conn, PaymentMOL payment); 
 String URL = service.getURL(Connection conn, PaymentMOL payment, String propertiesFileName); 
 </pre> 

 # *conn*             - Database connection. 
 # *payment*          - PaymentMOL object. 
 > * *orderId*        - Order ID. 
 > * *amount*         - Transaction amount. (Must greater than 1) 
 > * *currency*       - Currency. (Max 3 characters) 
 > * *name*           - Shopper Name. 
 > * *email*          - Shopper Email. 
 > * *mobile*         - Shopper Mobile. 
 > * *description*    - Transaction description. 
 > * *trxType*        - Transaction Type. 
 > * *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) 
 > * *shopperRefNo* - Shopper Reference Number. 
 > * *returnURL*      - Page to be return after transaction. 
 > * *callbackURL*     - Backend call after status updated.  
 > * *cancelURL*       - Page to be return before transaction 
 > * *paymentMethod* - Identity which payment method to process the payment.  
                     - Refer : com.ecosway.mol.common.PaymentInstallmentEnum (getName()=display name; getPage()=page to redirect;) 
                     - value to set : PaymentInstallmentEnum.MBB.name() 
 > * *installmonth*    - Number of Installment month. 


 h3. Update MOLPay Response into Database 

 <pre> 
 com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request) 
 com.ecosway.mol.model.ResponseMOL res = service.updateTransaction(Connection conn, HttpServletRequest request, String propertiesFileName) 
 </pre> 

 # *ResponseMOL* 
 > * orderId - String 
 > * amount - double 
 > * tranId - int 
 > * status - String 
 > * errorCode - String 
 > * errorDesc - String 
 > * currency - String 
 > * payDate - Date 
 > * valid - boolean