支付宝对接支付-JAVA版

前言

本文使用SpringBoot+SpringMVC对接支付宝电脑网站支付接口。接下来将详细讲解开发步骤及一些常见问题。

官方文档:https://opendocs.alipay.com/open/270

1.首先打开支付宝开放平台,
在这里插入图片描述
2.点击研发服务。因为正式接入需要企业签约,所以我们这里先用沙盒模式进行模拟接入,完成签约后将程序中的部分参数替换即可。
在这里插入图片描述
3.点击沙盒应用,查看APPID等参数
在这里插入图片描述
4.设置RSA2密钥
在这里插入图片描述
使用官方密钥生成工具生成密钥,将生成的密钥填入
在这里插入图片描述
时序图
在这里插入图片描述

正式开发

依赖pom.xml

		<parent>
	        <groupId>org.springframework.boot</groupId>
	        <artifactId>spring-boot-starter-parent</artifactId>
	        <version>2.2.4.RELEASE</version>
	        <relativePath/> <!-- lookup parent from repository -->
	    </parent>
		<dependencies>
	        <dependency>
	            <groupId>org.springframework.boot</groupId>
	            <artifactId>spring-boot-starter-web</artifactId>
	        </dependency>
	
	        <dependency>
	            <groupId>org.springframework.boot</groupId>
	            <artifactId>spring-boot-devtools</artifactId>
	            <scope>runtime</scope>
	            <optional>true</optional>
	        </dependency>
	        <dependency>
	            <groupId>org.projectlombok</groupId>
	            <artifactId>lombok</artifactId>
	            <optional>true</optional>
	        </dependency>
	        <dependency>
	            <groupId>org.springframework.boot</groupId>
	            <artifactId>spring-boot-starter-thymeleaf</artifactId>
	            <version>2.2.4.RELEASE</version>
	        </dependency>
	        <dependency>
	            <groupId>org.springframework.boot</groupId>
	            <artifactId>spring-boot-starter-test</artifactId>
	            <scope>test</scope>
	            <exclusions>
	                <exclusion>
	                    <groupId>org.junit.vintage</groupId>
	                    <artifactId>junit-vintage-engine</artifactId>
	                </exclusion>
	            </exclusions>
	        </dependency>
	        <!--支付宝支付SDK-->
	        <dependency>
	            <groupId>com.alipay.sdk</groupId>
	            <artifactId>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值