Payment Spring Boot

微信支付V3支付,支持微信优惠券,代金券、商家券、公众号支付、微信小程序支付、分账、支付分、商家券、
Alternatives To Payment Spring Boot
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Ijpay4,26284a month ago53August 23, 20228otherJava
IJPay 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付、PayPal 支付等常用的支付方式以及各种常用的接口。不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。右上角点下小星星✨
Mall4j3,484
2 days ago7agpl-3.0Java
⭐️⭐️⭐️ 电商商城 java电商商城系统 uniapp商城 多用户商城
Atsea Sample Shop App590
a year agoapache-2.0Java
A sample app that uses a Java Spring Boot backend connected to a database to display a fictitious art shop with a React front-end.
Payment Spring Boot537
10 days agoapache-2.0HTML
微信支付V3支付,支持微信优惠券,代金券、商家券、公众号支付、微信小程序支付、分账、支付分、商家券、合单支付、先享卡、电商收付通等全部微信支付功能API,同时满足服务商、商户开发需求。一键集成,上手快,欢迎star。
Hsweb Payment108
4 years ago1apache-2.0JavaScript
基于hsweb的开源聚合支付系统,多商户,多渠道,多配置.
Food_ordering_system52
5 years ago1mitJava
Food Ordering System [Maybe Deprecated]
Spring Boot Ddd46
2 years agogpl-3.0Java
Spring boot with domain driven design
Compose Pay24
6 months ago1apache-2.0Java
:trident: HA distributed payment gateway. 高可用分布式支付网关/支付前置/支付系统/微信/支付宝
Paypal Springboot24
5 years ago2Java
paypal payment sample using spring boot, paypal java SDK, thymeleaf
Spring Boot Starter Wechatmp21
7 years agoJava
Spring Boot with Wechat Support
Alternatives To Payment Spring Boot
Select To Compare


Alternative Project Comparisons
Readme

V3 Spring Boot

QQ

Star

JavaV3Spring Boot StarterAPIAPIstar

Maven


<dependency>
    <groupId>cn.felord</groupId>
    <artifactId>payment-spring-boot-starter</artifactId>
    <version>1.0.17.RELEASE</version>
</dependency>

JDK

Open JDKFBI Warning

API

APIAPI

APIWechatPayV3TypeAPI

CHANGELOG

CHANGELOG

payment-spring-boot GitHub

@EnableMobilePay

import cn.felord.payment.autoconfigure.EnableMobilePay;
import org.springframework.context.annotation.Configuration;

@EnableMobilePay
@Configuration
public class PayConfig {
}

Spring MVC WechatApiProvider

import cn.felord.payment.wechat.enumeration.TradeBillType;
import cn.felord.payment.wechat.v3.WechatApiProvider;
import cn.felord.payment.wechat.v3.WechatDirectPayApi;
import cn.felord.payment.wechat.v3.model.*;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.time.Month;

/**
 * .
 */
@Profile({"wechat", "dev"})
@RestController
@RequestMapping("/marketing")
public class PayController {
    @Autowired
    private WechatApiProvider wechatApiProvider;
    String TENANT_ID = "mobile";

    /**
     *   ->  ->  ->  -> 
     * <p>
     * 
     *
     * @param orderId id
     * @return the object node
     */
    @PostMapping("/js")
    public ObjectNode js(@RequestParam String orderId) {

        //TODO
        // orderId
        // 
        //  
        //  
        // 
        //  
        // 
        // 
        //  /wxpay/callbacks/transaction  

        //   mobile  application-wechat.yml


        PayParams payParams = new PayParams();

        payParams.setDescription("felord.cn");
        //
        //    
        payParams.setOutTradeNo("X135423420201521613448");
        // 
        payParams.setNotifyUrl("/wxpay/callbacks/transaction");
        Amount amount = new Amount();
        amount.setTotal(100);
        payParams.setAmount(amount);
        //   Payer   openidappid 
        Payer payer = new Payer();
        payer.setOpenid("ooadI5kQYrrCqpgbisvC8bEw_oUc");
        payParams.setPayer(payer);

        return wechatApiProvider.directPayApi(TENANT_ID)
                .jsPay(payParams)
                .getBody();
    }


    /**
     *  
     *
     * @return the response entity
     */
    @GetMapping("/tradebill")
    public ResponseEntity<Resource> download() {
        WechatDirectPayApi wechatDirectPayApi = wechatApiProvider.directPayApi(TENANT_ID);

        TradeBillParams tradeBillParams = new TradeBillParams();
        tradeBillParams.setBillDate(LocalDate.of(2021, Month.MAY, 20));
        tradeBillParams.setBillType(TradeBillType.ALL);
        return wechatDirectPayApi.downloadTradeBill(tradeBillParams);
    }

    /**
     *   
     *
     * @return the response entity
     */
    @GetMapping("/fundflowbill")
    public ResponseEntity<Resource> fundFlowBill() {
        WechatDirectPayApi wechatDirectPayApi = wechatApiProvider.directPayApi(TENANT_ID);

        FundFlowBillParams fundFlowBillParams = new FundFlowBillParams();
        fundFlowBillParams.setBillDate(LocalDate.of(2021, Month.MAY, 20));

        return wechatDirectPayApi.downloadFundFlowBill(fundFlowBillParams);
    }
}

IDtenantId

import cn.felord.payment.wechat.v3.WechatApiProvider;
import cn.felord.payment.wechat.v3.WechatMarketingFavorApi;
import cn.felord.payment.wechat.v3.WechatPayCallback;
import cn.felord.payment.wechat.v3.model.ResponseSignVerifyParams;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * application-wechat.yaml
 * <p>
 * 
 * <p>
 * 
 * 
 * 
 * <p>
 * {@link java.util.function.Consumer}
 * <p>
 * {@link WechatPayCallback} 
 * @author felord.cn
 * @since 1.0.0.RELEASE
 */
@Profile({"wechat", "dev"})
@RestController
@RequestMapping("/wxpay/callbacks")
public class CallbackController {
    private static final String TENANT_ID = "mobile";
    @Autowired
    private WechatApiProvider wechatApiProvider;


    /**
     * .
     * <p>
     * {@link WechatMarketingFavorApi#setMarketingFavorCallback(String)} !
     *
     * @param wechatpaySerial    the wechatpay serial
     * @param wechatpaySignature the wechatpay signature
     * @param wechatpayTimestamp the wechatpay timestamp
     * @param wechatpayNonce     the wechatpay nonce
     * @param request            the request
     * @return the map
     */
    @SneakyThrows
    @PostMapping("/coupon")
    public Map<String, ?> couponCallback(
            @RequestHeader("Wechatpay-Serial") String wechatpaySerial,
            @RequestHeader("Wechatpay-Signature") String wechatpaySignature,
            @RequestHeader("Wechatpay-Timestamp") String wechatpayTimestamp,
            @RequestHeader("Wechatpay-Nonce") String wechatpayNonce,
            HttpServletRequest request) {
        String body = request.getReader().lines().collect(Collectors.joining());
        //  
        ResponseSignVerifyParams params = new ResponseSignVerifyParams();
        params.setWechatpaySerial(wechatpaySerial);
        params.setWechatpaySignature(wechatpaySignature);
        params.setWechatpayTimestamp(wechatpayTimestamp);
        params.setWechatpayNonce(wechatpayNonce);
        params.setBody(body);
        return wechatApiProvider.callback(TENANT_ID).couponCallback(params, data -> {
            //TODO    
        });
    }

    /**
     * .
     * <p>
     * 
     *
     * @param wechatpaySerial    the wechatpay serial
     * @param wechatpaySignature the wechatpay signature
     * @param wechatpayTimestamp the wechatpay timestamp
     * @param wechatpayNonce     the wechatpay nonce
     * @param request            the request
     * @return the map
     */
    @SneakyThrows
    @PostMapping("/transaction")
    public Map<String, ?> transactionCallback(
            @RequestHeader("Wechatpay-Serial") String wechatpaySerial,
            @RequestHeader("Wechatpay-Signature") String wechatpaySignature,
            @RequestHeader("Wechatpay-Timestamp") String wechatpayTimestamp,
            @RequestHeader("Wechatpay-Nonce") String wechatpayNonce,
            HttpServletRequest request) {
        String body = request.getReader().lines().collect(Collectors.joining());
        //  
        ResponseSignVerifyParams params = new ResponseSignVerifyParams();
        params.setWechatpaySerial(wechatpaySerial);
        params.setWechatpaySignature(wechatpaySignature);
        params.setWechatpayTimestamp(wechatpayTimestamp);
        params.setWechatpayNonce(wechatpayNonce);
        params.setBody(body);
        return wechatApiProvider.callback(TENANT_ID).transactionCallback(params, data -> {
            //TODO    
        });
    }

    /**
     * .
     * <p>
     * 
     *
     * @param wechatpaySerial    the wechatpay serial
     * @param wechatpaySignature the wechatpay signature
     * @param wechatpayTimestamp the wechatpay timestamp
     * @param wechatpayNonce     the wechatpay nonce
     * @param request            the request
     * @return the map
     */
    @SneakyThrows
    @PostMapping("/combine_transaction")
    public Map<String, ?> combineTransactionCallback(
            @RequestHeader("Wechatpay-Serial") String wechatpaySerial,
            @RequestHeader("Wechatpay-Signature") String wechatpaySignature,
            @RequestHeader("Wechatpay-Timestamp") String wechatpayTimestamp,
            @RequestHeader("Wechatpay-Nonce") String wechatpayNonce,
            HttpServletRequest request) {
        String body = request.getReader().lines().collect(Collectors.joining());
        //  
        ResponseSignVerifyParams params = new ResponseSignVerifyParams();
        params.setWechatpaySerial(wechatpaySerial);
        params.setWechatpaySignature(wechatpaySignature);
        params.setWechatpayTimestamp(wechatpayTimestamp);
        params.setWechatpayNonce(wechatpayNonce);
        params.setBody(body);
        return wechatApiProvider.callback(TENANT_ID).combineTransactionCallback(params, data -> {
            //TODO    
        });
    }
}

Apache 2.0

QQ

QQ

QQ

Popular Spring Boot Projects
Popular Payment Projects
Popular Frameworks Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Html
Spring Boot
Payment
Wechat Pay
Wechat App
Wechat Sdk