								　      ─────────────────────────────────────────     
								                 Product name：UnionPay payment control
						 JDK：This JDK demo is based on jdk1.6.12u5 or above, v1.6.26 recommended
								                   Date：  2016-07-20
								    ─────────────────────────────────────────
───────────
 **NOTE**
1) Read the following guide before testing
2) This project can be run to test, IE or Chrome recommended
3) Private key certificate must be configured before testing transaction, which will be verified by public key certificate

UPOP primary credit transaction demo address: http://IP：port/ACPSample_AppServer
───────────

───────────
demo project directory structure
───────────

ACPSample_AppServer
  │
  ├src┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈class file folder
  │  │
  │  ├assets ┈┈┈┈┈┈┈┈┈related resource directory
  │  │  │  
  │  │  ├apache_httpclient┈┈┈┈┈┈┈┈┈http post method in apache 
  │  │  │
  │  │  ├configuration files for testing environment
  │  │  │   │  
  │  │  │   ├acp_sdk.properties.密钥 ┈┈┈┈┈┈┈┈┈ 【important】 configuration file demo for testing environment (signing by key) (usage please refer to the explanation in the file)
  │  │  │   │
  │  │  │   └acp_sdk.properties.证书 ┈┈┈┈┈┈┈┈┈【important】 configuration file demo for testing environment (signing by certificate) (usage please refer to the explanation in the file)
  │  │  │
  │  │  ├certificates for testing environment
  │  │  │   │
  │  │  │   ├acp_test_enc.cer┈┈┈┈┈┈┈┈┈ 【important】encryption certificate for sensitive information in testing environment (same one for all merchants) 
  │  │  │   │  
  │  │  │   ├acp_test_sign.pfx ┈┈┈┈┈┈┈┈┈ 【important】certificate for signature private key in testing environment（same one for all merchants）
  │  │  │   │  
  │  │  │   ├acp_test_root.cer ┈┈┈┈┈┈┈【important】root certificate for signature-verification public key in testing environment（same one for all merchants）   
  │  │  │   │
  │  │  │   └acp_test_middle.cer ┈┈┈┈┈┈【important】middle certificate for signature-verification public key in testing environment（same one for all merchants）  
  │  │  │
  │  │  ├reconciliation files demo
  │  │  │   │
  │  │  │   └802310048993424_20150905.zip  ┈┈┈┈┈┈┈┈┈reconciliation file demo（for reference）
  │  │  │  
  │  │  ├Notifications for the acquirers using back-end SDK
  │  │  │   │
  │  │  │   ├acp_test_sign_inst.pfx ┈┈┈┈┈┈┈┈┈【important】 certificate for signature private key in testing environment（same one for all merchants）
  │  │  │   │
  │  │  │   └Notifications for the acquirers using back-end SDK.txt 
  │  │  │  
  │  │  ├configuration files of production environment
  │  │  │   │
  │  │  │   ├acp_sdk.properties.密钥 ┈┈┈┈┈┈┈【important】configuration file demo of production environment (signing by key) (usage please refer to the explanation in the file)
  │  │  │   │
  │  │  │   └acp_sdk.properties.证书 ┈┈┈┈┈┈┈┈┈【important】configuration file demo of production environment (signing by certificate) (usage please refer to the explanation in the file)
  │  │  │
  │  │  └certificates for production environment
  │  │      │
  │  │      ├acp_prod_enc.cer┈┈┈┈┈┈┈┈┈【important】encryption certificate for sensitive information in production environment（same one for all merchants）
  │  │      │
  │  │      ├acp_prod_root.cer ┈┈┈┈┈┈┈┈【important】root certificate for signature-verification public key in production environment（same one for all merchants）   
  │  │      │
  │  │      └acp_prod_middle.cer ┈┈┈┈┈┈【important】middle certificate for signature-verification public key in production environment（same one for all merchants）    
  │  │  
  │  ├com.unionpay.acp.demo
  │  │  │
  │  │  ├BackRcvResponse.java┈┈┈┈┈Back-end notification demo
  │  │  │	
  │  │  ├DemoBase.java┈┈┈┈┈demo base	
  │  │  │
  │  │  ├EncryptCerUpdateQuery.java┈┈┈┈┈UnionPay encryption public key update inquiry
  │  │  │	
  │  │  ├Form05_6_2_AppConsume.java┈┈┈┈┈purchase（to obtain tn）demo	
  │  │  │	
  │  │  ├Form05_6_3_ConsumeUndo.java┈┈┈┈┈purchase cancellation		
  │  │  │
  │  │  ├Form05_6_3_Query.java┈┈┈┈┈transaction inquiry
  │  │  │
  │  │  ├Form05_6_4_Refund.java┈┈┈┈┈refund
  │  │  │
  │  │  ├Form05_7_FileTransfer.java┈┈┈┈┈file transportation（to download reconciliation file）
  │  │  │
  │  │  └using different certificates of private key for multiple MIDs (multiple certificates).txt 
  │  │   
  │  ├com.unionpay.acp.sdk
  │  │  │
  │  │  ├AcpService.java┈┈┈┈┈┈UPOP SDK API Interface
  │  │  │  
  │  │  ├CertUtil.java┈┈┈┈┈┈certificate tools
  │  │  │
  │  │  ├HttpClient.java┈┈┈┈┈http post communication for back-end transaction，if using proxy to visit or problem occurs, you can solve it yourself or using apache httpClient
  │  │  │
  │  │  ├LogUtil.java┈┈┈┈┈log tools
  │  │  │
  │  │  ├SDKConfig.java┈┈┈┈┈┈┈configuration for loading attribute file of "acp_sdk.properties" 
  │  │  │  
  │  │  ├SDKConstants.java┈┈┈┈┈┈┈SDK constants
  │  │  │    
  │  │  ├SDKUtil.java┈┈┈┈┈┈┈SDK tools，including the signature and signature-verification methods for message
  │  │  │   
  │  │  └SecureUtil.java┈┈┈┈┈┈┈security tools
  │  │  
  │  └web ┈┈┈┈┈┈┈┈┈ web related files
  │      │
  │      ├AutoLoadServlet.java ┈┈┈┈┈┈servlet for "acp_sdk.properties" loading initialization, UnionPay address for initialization request, certificates, etc.servlet
  │      │
  │      └CharsetEncodingFilter.java ┈┈┈┈web request code filter
  │
  ├acp_sdk.properties ┈┈┈┈【important】 config file for testing environment,request unionpay Url,certificate for signature private key,certificate for signature-verification public key, multi-certificate config file (Please replace this file with config file of production environment before switching to production environment)
  │
  ├log4j.properties ┈┈┈┈LogUtil.java log tools configuration file
  │
  ├WebContent ┈┈┈┈┈┈┈┈┈┈┈┈┈┈web content file
  │  │
  │  ├index.jsp ┈┈┈┈┈┈┈┈┈debuging entrance page (for purchase transaction)
  │  │  
  │  └WEB-INF
  │   	  │
  │       └lib（These jar packages do NOT have to be imported again if contained in the JAVA project）
  │   	     │
  │   	     ├bcprov-jdk16-1.45.jar
  │   	     │
  │   	     ├commons-codec-1.6.jar
  │   	     │
  │   	     ├commons-io-2.2.jar
  │   	     │
  │   	     ├commons-lang-2.5.jar
  │   	     │
  │   	     ├log4j-1.2.17.jar
  │   	     │
  │   	     ├slf4j-api-1.5.11.jar
  │   	     │
  │          └slf4j-log4j12-1.5.11.jar			 
  │   	     
  ├history.txt┈┈┈┈┈┈┈┈┈history of revision
  │
  └readme.txt ┈┈┈┈┈┈┈┈┈readme

───────────
 【Note】：


1.【About MID】
Please ignore the MID in the SDK demo and use your real MID for testing. IF error such as "no authority" occurs, please contact UPI to make sure if the authority is granted.
  
2.【About Configuration Files】
      
Configuration Files can be found in src/assets, signing by certificate is set as defult.


The certificate route will have to be configured if signing by certificate is chosen. All the certificates can be found in src/assets (except the signature certificate in production environment, which will be sent by mail)

When signing by key is chosen, the key for testing environment is 88888888, the key for production environment will be sent by mail.

───────────

