微信支付接入网址:https://pay.weixin.qq.com/index.php/core/home/login?return_url=%2F
微信公众号网址:https://mp.weixin.qq.com/cgi-bin/registermidpage?action=index&lang=zh_CN&token=
随机密码生成:https://suijimimashengcheng.bmcx.com/
获取密钥—>生成证书
项目实现:
1.依赖注入:
<!-- Swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<!-- Swagger ui-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
2.swagger配置:
@Configuration
@EnableSwagger2
public class Swagger2Config {
@Bean
public Docket docket(){
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder().title("微信支付开发文档").build());
}
}
// 之后访问 http://localhost:8090/swagger-ui.html#/
3.sql语句:
create database payment_demo;
USE `payment_demo`;
/*Table structure for table `t_order_info` */
DROP TABLE IF EXISTS `t_order_info`;
CREATE TABLE `t_order_info` (
`id` BIGINT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '订单id',
`title` VARCHAR(256) DEFAULT NULL COMMENT '订单标题',
`order_no` VARCHAR(50) DEFAULT NULL COMMENT '商户订单编号',
`user_id` BIGINT(20) DEFAULT NULL COMMENT '用户id',
`product_id` BIGINT(20) DEFAULT NULL COMMENT '支付产品id',
`total_fee` INT(11) DEFAULT NULL COMMENT '订单金额(分)',
`code_url` VARCHAR(50) DEFAULT NULL COMMENT '订单二维码连接'