Project

General

Profile

Deployment And Programming Guide » History » Revision 4

Revision 3 (Soh Keong, 04/12/2013 02:29 PM) → Revision 4/8 (Soh Keong, 04/12/2013 03:16 PM)

h1. Deployment And Programming Guide 

 h2. Resources 

 h3. SCM 

 see [[wiki#SCM]] 

 h3. File Download 

 "Jar file":http://192.168.2.13:50000/redmine/attachments/download/434/mPay-1.0-SNAPSHOT.jar file":http://192.168.2.13:50000/redmine/attachments/download/430/mPay-1.0-SNAPSHOT.jar 
 "mPay API":http://192.168.2.13:50000/redmine/attachments/download/429/mPay_api.rar (Please unzip it.) 
 "mPay cert and properties file":http://192.168.2.13:50000/redmine/attachments/download/433/mPay2.rar file":http://192.168.2.13:50000/redmine/attachments/download/428/mPay2.rar (Unzip to /data/mPay2 folder) 
 "Sample payment JSP":http://192.168.2.13:50000/redmine/attachments/download/431/mPay.jsp 
 "Sample response JSP":http://192.168.2.13:50000/redmine/attachments/download/432/mPayProcesses.jsp 

 h3. properties file 

 * *mPay.properties*  

 # *payment.url*        - Provided by mPay 
 # *enquiry.url*        - Provided by mPay 
 # *merchantid*         - Provided by mPay 
 # *merchant_tid*       - Provided by mPay 
 # *serverCertPath*     - server cert location and name 
 # *merchantCertPath* - merchant cert location and name 
 # *merchantCertPwd*    - Provided by mPay 

 h3. Database Table 

 <pre> 

 CREATE TABLE MPAY_INTERFACE (  
	 ORDER_ID VARCHAR(15) NOT NULL,  
	 TRX_TYPE VARCHAR(15) NOT NULL,  
	 SHOPPER_REF_NO INTEGER NOT NULL,  
	 CHARGE_AMT DECIMAL(15,2) NOT NULL,  
	 RESPONSE_CODE VARCHAR(4),  
	 IS_VALID CHARACTER NOT NULL,  
	 PAY_DATE TIMESTAMP,  
	 CREATE_DATETIME TIMESTAMP NOT NULL,  
	 MODIFY_DATETIME TIMESTAMP,  
	 PRIMARY KEY (ORDER_ID))  
 </pre> 


 *Get URL* 

 <pre> 
 com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl(); 

 String url = service.getURL(Connection conn, PaymentMPay pay)); 
 </pre> 

 # *conn*                 - Database connection. 
 # *payment*              - PaymentMPay object. 
 > * *aordernum*          - Order ID. 
 > * *aamt*               - Transaction amount. 
 > * *acurrencycode*      - Currency Code of transaction. Allowed only HKD, RMB and USD 
 > * *acustomizeddata*    - Remark message 
 > * *aTransactionType* - Transaction Type. 
 > * *aShopperRefID*      - Shopper Reference Number. 
 > * *adatetime*          - Order date of transaction. The value should be in the format of "yyyyMMddHHmmss" 
 > * *acardtype*          - To identify the payment method. ("14" represent PRC2.) 
 > * *areturnurl*         - Payment response will passed to in normal cases. 
 > * *afailurl*           - Payment response will passed to in abnormal cases. 
 > * *alocale*            - language used. Allowed only en_US, zh_TW, zh_CN. 



 *Update mPay Response into Database* 

 <pre> 
 com.ecosway.mpay.service.MPayService service = new com.ecosway.mpay.service.MPayServiceImpl(); 
 com.ecosway.mpay.model.ResponseMPay res = service.updateTransaction(Connection conn, HttpServletRequest res) 
 </pre> 

 # *ResponseMPay* 
 > * aordernum         - String 
 > * aamt              - double 
 > * acurrencycode     - String 
 > * acustomizeddata - String 
 > * aValid            - boolean 
 > * asysdatetime      - java.util.Date 
 > * arefnum           - String 
 > * asettledate       - String 
 > * arspcode          - String 
 > * aauthcode         - String