1 Star 1 Fork 1

赵亮亮/UnionPay-payment

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MulanPSL-2.0
       ─────────────────────────────────────────     
								           产品名称:  跳转网关支付产品
								      JDK:  本示例JDK版本基于jdk1.6.12u5以上建议1.6.26
								                   日期:  2016-07-20
								    ─────────────────────────────────────────
───────────
 **重要**
1) 联调前请仔细阅读以下说明
2) 此工程可以跑起来测试,建议使用IE,chrome打开
3) 测试界面中的交易时一定要先配置好私钥签名证书,验签公钥证书。即修改

                                                     全渠道PC网关/WAP支付产品消费交易示例地址为:http://IP:端口/ACPSample_B2C
───────────

───────────
示例工程目录结构
───────────

ACPSample_B2C
  │
  ├src┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈类文件夹
  │  │
  │  ├assets ┈┈┈┈┈┈┈┈┈相关资源目录
  │  │  │
  │  ├assets ┈┈┈┈┈┈┈┈┈相关资源目录
  │  │  │  
  │  │  ├apache_httpclient┈┈┈┈┈┈┈┈┈apache中的http post方法    
  │  │  │
  │  │  ├测试环境证书
  │  │  │   │
  │  │  │   ├acp_test_enc.cer ┈┈┈┈┈┈┈┈┈ 【重要】测试环境敏感信息加密证书(所有商户固定使用同一个)  
  │  │  │   │  
  │  │  │   ├acp_test_sign.pfx ┈┈┈┈┈┈┈┈┈ 【重要】 测试环境签名私钥证书(所有商户固定使用同一个)
  │  │  │   │  
  │  │  │   ├acp_test_root.cer ┈┈┈┈┈┈┈┈┈ 【重要】 测试环境验签公钥证书根证书  (所有商户固定使用同一个) 
  │  │  │   │
  │  │  │   └acp_test_middle.cer ┈┈┈┈┈┈┈┈┈【重要】 测试环境验签公钥证书中级证书  (所有商户固定使用同一个)  
  │  │  │  
  │  │  ├对账文件样例 
  │  │  │   │
  │  │  │   └802310048993424_20150905.zip  ┈┈┈┈┈┈┈┈┈提供的对账文件样例(如果需要可以参考)  
  │  │  │
  │  │  ├收单机构接入需做改动 
  │  │  │   │
  │  │  │   ├acp_test_sign_inst.pfx ┈┈┈┈┈┈┈┈┈【重要】 收单机构接入的测试环境签名私钥证书(所有机构固定使用同一个)
  │  │  │   │
  │  │  │   └机构接入需做改动.txt   
  │  │  │
  │  │  ├测试环境配置文件
  │  │  │   │  
  │  │  │   └acp_sdk.properties ┈┈┈┈┈┈┈┈┈【重要】 测试环境配置文件样例(证书方式签名)(使用方式请看文件里的说明)
  │  │  │  
  │  │  ├生产环境配置文件
  │  │  │   │
  │  │  │   └acp_sdk.properties ┈┈┈┈┈┈┈┈┈【重要】 生产环境配置文件样例(证书方式签名)(使用方式请看文件里的说明)
  │  │  │
  │  │  └生产环境证书
  │  │     │
  │  │     ├acp_prod_enc.cer┈┈┈┈┈┈┈┈┈【重要】 生产环境敏感信息加密证书(所有商户固定使用同一个)
  │  │     │
  │  │     ├acp_prod_root.cer ┈┈┈┈┈┈┈┈┈【重要】 生产环境验签公钥根证书  (所有商户固定使用同一个)  
  │  │     │
  │  │     └acp_prod_middle.cer ┈┈┈┈┈┈┈┈┈【重要】 生产环境验签公钥中级证书  (所有商户固定使用同一个)  
  │  │  
  │  │  
  │  ├com.unionpay.acp.demo
  │  │  │
  │  │	├consume ┈┈┈┈┈┈┈┈┈ 消费相关类
  │  │  │   │
  │  │  │   ├Form_6_2_FrontConsume.java┈┈┈┈┈前台跳转银联支付页面示例类(前台)
  │  │  │	│
  │  │  │	├Form_6_3_ConsumeUndo.java┈┈┈┈┈消费撤销交易示例类 (后台)
  │  │  │	│
  │  │  │	└PC wap网关跳转支付特殊用法.txt
  │  │  │
  │  │	├preauth  ┈┈┈┈┈┈┈┈┈ 预授权相关类
  │  │  │   │
  │  │  │   ├Form_6_7_1_AuthDeal_Front.java┈┈┈┈┈前台跳转银联预授权页面示例类(前台)
  │  │  │	│
  │  │  │	├Form_6_7_2_AuthUndo.java┈┈┈┈┈预授权撤销交易示例类 (后台)
  │  │  │	│
  │  │  │	├Form_6_7_3_AuthFinish.java┈┈┈┈┈预授权完成交易示例类 (后台)
  │  │  │	│
  │  │  │	├Form_6_7_4_AutnFinishUndo.java┈┈┈┈┈预授权完成撤销交易示例类 (后台)
  │  │  │	│
  │  │  │	└PC wap网关跳转预授权特殊用法.txt
  │  │  │
  │  │  ├BackRcvResponse.java┈┈┈┈┈后台通知处理示例类
  │  │  │
  │  │  ├DemoBase.java┈┈┈┈┈基础类
  │  │  │
  │  │  ├EncryptCerUpdateQuery.java┈┈┈┈┈加密证书更新示例类(后台)  
  │  │  │
  │  │  ├Form_6_4_Refund.java┈┈┈┈┈退货交易示例类 (后台)
  │  │  │  
  │  │  ├Form_6_5_Query.java┈┈┈┈┈交易状态查询示例类 (后台)
  │  │  │  
  │  │  ├Form_6_5_Query.java┈┈┈┈┈交易状态查询示例类 (后台)
  │  │  │
  │  │  ├Form_6_6_FileTransfer.java┈┈┈┈┈对账文件下载示例类 (后台)  
  │  │  │
  │  │  └FrontRcvResponse.java┈┈┈┈┈前台通知处理示例类 (后台)  
  │  │   
  │  ├com.unionpay.acp.sdk
  │  │  │  
  │  │  ├AcpService.java┈┈┈┈┈┈全渠道SDK API接口类
  │  │  │
  │  │  ├CertUtil.java┈┈┈┈┈┈证书处理工具类
  │  │  │
  │  │  ├HttpClient.java┈┈┈┈┈后台交易http post通讯类,如果要使用代理访问或者产生了问题那么可以自行解决或者使用apache httpClient
  │  │  │
  │  │  ├LogUtil.java┈┈┈┈┈日志工具类
  │  │  │
  │  │  ├SDKConfig.java┈┈┈┈┈┈┈读取acp_sdk.properties属性文件并填装配置的属性的配置类
  │  │  │  
  │  │  ├SDKConstants.java┈┈┈┈┈┈┈常量类
  │  │  │    
  │  │  ├SDKUtil.java┈┈┈┈┈┈┈SDK工具类,包含了对报文的签名,字符串转换等方法
  │  │  │   
  │  │  ├SecureUtil.java┈┈┈┈┈┈┈安全相关工具类
  │  │  │   
  │  │  └SM3Digest.java┈┈┈┈┈┈┈sm3算法工具类
  │  │
  │  └web ┈┈┈┈┈┈┈┈┈ web相关类
  │      │
  │      ├AutoLoadServlet.java ┈┈┈┈┈┈初始化读取acp_sdk.properties初始化请求银联地址,证书等相关资源的servlet
  │      │
  │      └CharsetEncodingFilter.java ┈┈┈┈web请求编码过滤器
  │
  ├acp_sdk.properties ┈┈┈┈***重要*** 测试环境配置文件,请求银联地址,私钥签名证书,验签公钥路径,多证书的配置文件(这个文件切换生产的时候要替换成生产环境的配置文件)
  │
  ├log4j.properties ┈┈┈┈LogUtil.java日志工具类的配置文件
  │
  ├WebContent ┈┈┈┈┈┈┈┈┈┈┈┈┈┈页面文件夹
  │  │
  │  ├index.jsp ┈┈┈┈┈┈┈┈┈调试入口页面(消费交易)
  │  │  
  │  ├index_preauth.jsp ┈┈┈┈┈┈┈┈┈调试入口页面(预授权交易)  
  │  │
  │  ├utf8_result.jsp ┈┈┈┈┈┈┈┈┈┈┈前台通知结果页面
  │  │
  │  └WEB-INF
  │   	  │
  │       └lib(如果JAVA项目中包含这些架包,则不需要导入)
  │   	     │
  │   	     ├bcprov-jdk15on-1.54.jar---------注意包名后缀版本,低版本的bc包不支持sdk使用的部分方法
  │   	     │
  │   	     ├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
  │
  └readme.txt ┈┈┈┈┈┈┈┈┈使用说明文本

───────────
 **注意**

1.【接口规范】该接口参考文档位置:
      接口产品规范:open.unionpay.com帮助中心 下载  产品接口规范  《网关产品接口规范》
      应答码规范:《平台接入接口规范-第5部分-附录》

2.【关于商户号】开发包中使用的商户号777290058110048是open.unionpay.com注册的测试商户号,只能在入网测试环境使用;
      可以先使用这个商户调通交易(当然您也可以自己在这个网站注册一个777开头的测试商户号,自己注册后要开通权限:https://open.unionpay.com 登陆后 右上角我的测试-我的产品-将未测试的产品点击成测试状态,过10分钟后就有权限了)
      正式线上环境请替换成申请的正式商户号,并确保商户号有对应的权限,如果报了无此交易权限等错误,请联系您申请接入银联的业务人员确认您做的交易是否开通了对应的权限。
  
3.【关于配置文件】
      配置文件在src/assets文件夹下可以找到,src下面默认使用的是测试环境使用证书方式签名的配置文件。请按配置文件中的说明进行修改。
      使用证书方式签名时需要配置证书路径,证书文件除了生产环境的签名证书需要业务邮件发送下载方式下载,其余证书均在src/assets文件夹下面有提供,需要复制到配置文件配置的路径。
      使用密钥方式签名时,测试环境密钥88888888,生产环境密钥由业务邮件发送。

4.测试过程中的如果遇到疑问或问题您可以:
  1)优先在open平台中查找答案:
  	 调试过程中的问题或其他问题请在 https://open.unionpay.com/ajweb/help/faq/list 帮助中心 FAQ 搜索解决方案
             测试过程中产生的6位应答码问题疑问请在https://open.unionpay.com/ajweb/help/respCode/respCodeList 输入应答码搜索解决方案
  2)咨询【测试环境】在线人工支持: open.unionpay.com注册一个用户并登陆在右上角点击“在线客服”,咨询人工QQ测试支持,咨询的时候需把 请求报文,请求银联地址,报错描述 贴给支持人员以方便查问题。
  3)测试环境测试支付请使用测试卡号测试, FAQ搜索“测试卡号”。
  4)切换生产环境要点请FAQ搜索“切换”。
  
5.【生产环境问题】连接银联生产环境测试遇到的问题 如果通过open平台无法解决 请登陆merchant.unionpay.com 菜单"服务单管理"->"创建服务单"请求排查问题。

───────────
木兰宽松许可证, 第2版 木兰宽松许可证, 第2版 2020年1月 http://license.coscl.org.cn/MulanPSL2 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: 0. 定义 “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 “法人实体”是指提交贡献的机构及其“关联实体”。 “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 1. 授予版权许可 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 2. 授予专利许可 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 3. 无商标许可 “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 4. 分发限制 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 5. 免责声明与责任限制 “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 6. 语言 “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 条款结束 如何将木兰宽松许可证,第2版,应用到您的软件 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; 3, 请将如下声明文本放入每个源文件的头部注释中。 Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. Mulan Permissive Software License,Version 2 Mulan Permissive Software License,Version 2 (Mulan PSL v2) January 2020 http://license.coscl.org.cn/MulanPSL2 Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: 0. Definition Software means the program and related documents which are licensed under this License and comprise all Contribution(s). Contribution means the copyrightable work licensed by a particular Contributor under this License. Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. Legal Entity means the entity making a Contribution and all its Affiliates. Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. 1. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. 2. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. 3. No Trademark License No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. 4. Distribution Restriction You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. 5. Disclaimer of Warranty and Limitation of Liability THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 6. Language THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. END OF THE TERMS AND CONDITIONS How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

简介

银联支付测试环境demo代码 展开 收起
Java
MulanPSL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/zhao_liangliang1997/UnionPay-payment.git
git@gitee.com:zhao_liangliang1997/UnionPay-payment.git
zhao_liangliang1997
UnionPay-payment
UnionPay-payment
master

搜索帮助