Project

General

Profile

Specification » History » Revision 10

Revision 9 (Soh Keong, 09/14/2023 02:33 PM) → Revision 10/11 (Soh Keong, 09/14/2023 02:39 PM)

{{toc}} 

 h1. Specification 

 h1. Activity Diagram 

 !flow.png! 
 !flow_UnionPay.png! 

 h1. Programming Guide 

 h2. Jar version  

 |_. version |_. Description       | 
 | 1.3         | Init                | 
 | 1.5         | Added Installment | 

 h3. Jar File Download 

 "Jar":/redmine/attachments/download/571/TaiShin-1.5.jar 
 "Properties":/redmine/attachments/download/539/taishin.properties 

 h2. properties file 

 * *taishin.properties* 

 # *sender*        
 # *version*        
 # *merchant.id*    
 # *sub.merchant.id*   
 # *terminal.id*       
 # *union.pay.timeout.in.minute*   
 # *union.pay.ip.address*         
 # *payment.url.credit.card*       
 # *payment.url.union.pay*         
 # *query.url.credit.card*         
 # *query.url.union.pay*         
 # *cacerts.alias*         
 # *cacerts.file*        
 # *cacerts.Pass*     
 # *CONNECTION_TIMEOUT*     
 # *READ_TIMEOUT* 

 h2. Database Table 

 <pre> 
 CREATE TABLE TSPG_INTERFACE ( 
	 ORDER_ID VARCHAR(15) NOT NULL,  
	 TRX_TYPE VARCHAR(5),  
	 SHOPPER_REF_NO INTEGER,  
	 CURRENCY VARCHAR(3), 
	 CHARGE_AMT DECIMAL(15,2),  
	 TSPG_PAYMENT_TYPE INTEGER, 
	 APP_CODE VARCHAR(8),  
	 STATUS VARCHAR(2),  
	 ERROR_CODE VARCHAR(5),  
	 ERROR_DESC VARCHAR(100),  
	 IS_VALID CHARACTER NOT NULL,  
	 TRAN_ID VARCHAR(30), 
	 PAY_DATE TIMESTAMP,  
	 INST_ORDER_ID VARCHAR(15), 
	 INST_PERIOD INTEGER, 
	 INST_DOWN_PAY DECIMAL(15,2), 
	 INST_PAY DECIMAL(15,2), 
	 CREATE_DATETIME TIMESTAMP NOT NULL,  
	 MODIFY_DATETIME TIMESTAMP,  
	 PRIMARY KEY (ORDER_ID)) 
 </pre>     


 h2. Tai Shin Service 

 <pre> 
 com.aces.ts.service.TaiShinService service = new com.aces.ts.service.TaiShinService(); 
 </pre> 

 h3. getURL 

 <pre> 
 String url = service.getURL(Connection conn, PaymentTaiShin payment) 
 </pre> 

 # *conn*             - Database connection. 
 # *payment*          - PaymentTaiShin object. 
 > * *orderId*            - Order ID. 
 > * *amount*             - Transaction amount.  
 > * *currency*           - com.aces.ts.common.CommonConstants.CURRENCY_CODE_TAIWAN 
 > * *trxType*            - 
 > * *tsPaymentMethod*    - com.aces.ts.common.CommonConstants.PARAM_PAY_TYPE_CREDIT_CARD | PARAM_PAY_TYPE_UNION_PAY 
 > * *layout*             - com.aces.ts.common.CommonConstants.PARAM_LAYOUT_NORMAL_WEB | PARAM_LAYOUT_MOBILE_WEB 
 > * *description*        - 
 > * *captFlag*           - com.aces.ts.common.CommonConstants.PARAM_CAPT_FLAG_ASYNCHRONOUS | PARAM_CAPT_FLAG_SYNCHRONOUS 
 > * *resultFlag*         - com.aces.ts.common.CommonConstants.PARAM_RESULT_FLAG_NO_DETAILS | PARAM_RESULT_FLAG_WITH_DETAILS 
 > * *browserReturnURL* - 
 > * *serverReturnURL*    - 
 > * *shopperRefNo*       - 
 > * *InstallPeriod*      -  

 h3. updateTransaction 

 <pre> 
 ResponseTaiShin = updateTransaction(Connection conn, HttpServletRequest request) 
 </pre> 

 # *ResponseTaiShin* 
 > * errorCode -  
 > * errorDesc -  
 > * orderId     - String 
 > * amount      - double 
 > * currency    -  
 > * appCode     - 
 > * tranId      -  
 > * status      -  
 > * payDate     - Date 
 > * valid       - boolean 
 > * installmentOrderId - 
 > * installmentPeriod    - 
 > * installmentDownPay - 
 > * installmentPay       - 

 h2. Keystore 

 h3. Windows 

 cd C:\java\JDK8\bin 
 keytool -import -file "C:\project\paymentGateway\TW\TSPG\taishin_live.cer" -keystore "E:\DevelopmentTools\java\JDK8\jre\lib\security\cacerts"    -alias "taishin_live" 
 keytool -list -v -keystore "C:\java\JDK8\jre\lib\security\cacerts"    -storepass changeit -alias "taishin_live" 
 keytool -delete -keystore "C:\java\JDK8\jre\lib\security\cacerts"    -storepass changeit -alias "taishin_live" 

 h3. Linux 
 cp /usr/local/jdk1.8.0_171/jre/lib/security/cacerts /usr/local/jdk1.8.0_171/jre/lib/security/cacerts.bak 
 


 /usr/local/jdk1.8.0_171/bin/keytool -delete -v -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -alias "taishin" -storepass changeit 
 /usr/local/jdk1.8.0_171/bin/keytool -importcert -file "/data/tspg/taishin.cer" -alias "taishin" -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -storepass changeit 
 /usr/local/jdk1.8.0_171/bin/keytool -list -v -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -alias "taishin" -storepass changeit 



 
 /usr/local/jdk1.8.0_171/bin/keytool -delete -v -keystore "/usr/local/jdk1.8.0_171/jre/lib/security/cacerts" -alias "taishin" -storepass changeit