0、首先进入商户网站
1、选择测试—>网关支付(证书下载)
2、 Demo文件下载:
3、自己创建maven项目:
(一)导入下图文件到java目录下,然后将其中的demo文件夹直接删除
(二)从demo文件中导入DemoBase[最终代码结构]
(三)需要的jar包
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.54</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
(四)导入配置文件
(5)更换证书路径
4、开始对接:
(一)首先打开下图
(二)复制内容
(三)粘贴
(四)更换测试商户号码
商户号码换成自己的、商户订单号可以使用"DD"+System.currentTimeMillis()
5、运行报错
(一)报错截图
(二)报错原因是:我们需要写一个证书类
(三)运行
(四)如果出现32,则需要取测试中集成测试
6、开始接
运行代码,测试你的支付接口
(一)你需要的参数、见下图
(二)在左侧点下一步
(三)成功
7、支付回调:
(一)首先在controller中创建CallbackController,然后打开开发包
(二)打开上图文件后,复制到CallbackController
(三)前台通知[操作与后台类似]
(四)打开上图文件后,复制到CallbackController中的front
(五)最后修改通知地址
(六)完美撒花
代码见: https://gitee.com/zhao_liangliang1997
正式接入
8、证书获取
(一)首先根据银联证书领取文档,获取到.pfx签名证书
(二)根据银联提供的demo文件找到其他三个证书