电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口

1 后台接口

  • pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>
    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.1.16.RELEASEversion>
        <relativePath/> 
    parent>
    <groupId>com.tzb.wxpaygroupId>
    <artifactId>mywxpayartifactId>
    <version>0.0.1-SNAPSHOTversion>
    <name>mywxpayname>
    <description>Demo project for Spring Bootdescription>

    <properties>
        <java.version>1.8java.version>
    properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
        <dependency>
            <groupId>org.mybatis.spring.bootgroupId>
            <artifactId>mybatis-spring-boot-starterartifactId>
            <version>2.1.3version>
        dependency>

        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            
            <version>5.1.49version>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-testartifactId>
            <scope>testscope>
        dependency>

        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>druid-spring-boot-starterartifactId>
            <version>1.1.10version>
        dependency>
    dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resourcesdirectory>
            resource>
            <resource>
                <directory>src/main/javadirectory>
                <includes>
                    <include>**/*.xmlinclude>
                includes>
            resource>
        resources>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <version>2.1.16.RELEASEversion>
            plugin>
        plugins>
    build>

project>


  • application.properties
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.dataSource.username=root
spring.datasource.password=root
spring.datasource.url=jdbc:mysql:///wxpay?characterEncoding=UTF-8&useSSL=false

1.1 Controller

package com.tzb.wxpay.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/wxpay")
public class WXPayController {

    @RequestMapping("/notify_url")
    @ResponseBody
    public String getNotifyURL(){

        return "success";
    }
}

  • 启动项目,然后测试
    电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第1张图片

2 内网穿透

https://natapp.cn/
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第2张图片
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第3张图片
在这里插入图片描述


  • 然后下载客户端,cmd 切换到这个路径下,输入指令

电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第4张图片
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第5张图片

电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第6张图片
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第7张图片

3 测试回调接口

电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第8张图片
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第9张图片
电商系统前后端开发(Vue+Springboot)(24) - 微信支付后台接口_第10张图片

你可能感兴趣的:(#,vue,springboot,微信支付后台接口)