Project

General

Profile

Specification » History » Revision 8

Revision 7 (Soh Keong, 01/14/2013 09:29 AM) → Revision 8/9 (Soh Keong, 02/05/2013 03:29 PM)

h1. Specification 

 h1. Activity Diagram 

 !ecpg.png! 

 h1. Programming Guide 

 h2. Resources 

 h3. SCM 

 see [[wiki#SCM]] 

 h3. Jar File Download 

 "Download Page":http://192.168.2.13:50000/redmine/projects/ecpg/files 

 h3. Classes 

 * *com.ecosway.ecpg.common* - CommonConstants, CommonProperties 
 * *com.ecosway.ecpg.dao* - ECPGInterface 
 * *com.ecosway.ecpg.model* - CommonECPG, PaymentECPG, ResponseECPG 
 * *com.ecosway.ecpg.service* - ECPGService, ECPGServiceImpl 

 h3. properties file 

 * *ecpg.properties* 

 # *merchant.id*         - Merchant id, given by NCCC (National Credit Card Center of R.O.C) 
 # *payment.url*         - Front-end payment page URL 
 # *terminal.id*         - Terminal id, given by NCCC (National Credit Card Center of R.O.C) 

 h3. Database Table 

 <pre> 
 CREATE TABLE ECOS.ECPG_INTERFACE ( 
	 ORDER_ID VARCHAR(15) NOT NULL,  
	 TRX_TYPE VARCHAR(5), 
	 SHOPPER_REF_NO INTEGER, 
	 CHARGE_AMT DECIMAL(15,2), 
	 APP_CODE VARCHAR(8), 
	 STATUS VARCHAR(2),  
	 ERROR_CODE VARCHAR(3), 
	 ERROR_DESC VARCHAR(60), 
	 IS_VALID CHARACTER NOT NULL,  
	 PAY_DATE TIMESTAMP, 
	 CREATE_DATETIME TIMESTAMP NOT NULL, 
	 MODIFY_DATETIME TIMESTAMP,  
	 PRIMARY KEY (ORDER_ID)) 
 </pre> 

 *Get ECPG URL* 

 <pre> 
 com.ecosway.ecpg.service.ECPGService service = new com.ecosway.ecpg.service.ECPGServiceImpl(); 

 String URL = service.getURL(Connection conn, PaymentECPG payment); 

 </pre> 

 # *conn*             - Database connection. 
 # *payment*          - PaymentECPG object. 
 > * *orderId*        - Order ID. 
 > * *amount*         - Transaction amount. 
 > * *trxType*        - Transaction Type. 
 > * *shopperRefNo* - Shopper Reference Number. 
 > * *returnURL*      - Page to be return after transaction. 
 > * *trxMode*        - Value may get from com.ecosway.ecpg.common.CommonConstants (TRANSMODE_BASIC & TRANSMODE_INSTALLMENT). 
 > * *install*        - Number of installment. (Require only if trxMode = TRANSMODE_INSTALLMENT) 

 *Update ECPG Response into Database* 

 <pre> 
 com.ecosway.ecpg.service.ECPGService service = new com.ecosway.ecpg.service.ECPGServiceImpl(); 
 com.ecosway.ecpg.model.ResponseECPG res = service.updateTransaction(Connection conn, HttpServletRequest request) 
 </pre> 

 # *ResponseECPG* 
 > * orderId        - String 
 > * amount         - double 
 > * status         - String 
 > * responseCode - String 
 > * responseMsg    - String 
 > * authCode       - String 
 > * payDate        - Date 
 > * valid          - boolean 
 > * trxMode        - String 
 > * firstAmt       - double 
 > * eachAmt        - double 
 > * fee            - double