Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Ijpay | 4,262 | 8 | 4 | a month ago | 53 | August 23, 2022 | 8 | other | Java | |
IJPay 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付、PayPal 支付等常用的支付方式以及各种常用的接口。不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。右上角点下小星星✨ | ||||||||||
Mall4j | 3,484 | 2 days ago | 7 | agpl-3.0 | Java | |||||
⭐️⭐️⭐️ 电商商城 java电商商城系统 uniapp商城 多用户商城 | ||||||||||
Atsea Sample Shop App | 590 | a year ago | apache-2.0 | Java | ||||||
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 Boot | 537 | 10 days ago | apache-2.0 | HTML | ||||||
微信支付V3支付,支持微信优惠券,代金券、商家券、公众号支付、微信小程序支付、分账、支付分、商家券、合单支付、先享卡、电商收付通等全部微信支付功能API,同时满足服务商、商户开发需求。一键集成,上手快,欢迎star。 | ||||||||||
Hsweb Payment | 108 | 4 years ago | 1 | apache-2.0 | JavaScript | |||||
基于hsweb的开源聚合支付系统,多商户,多渠道,多配置. | ||||||||||
Food_ordering_system | 52 | 5 years ago | 1 | mit | Java | |||||
Food Ordering System [Maybe Deprecated] | ||||||||||
Spring Boot Ddd | 46 | 2 years ago | gpl-3.0 | Java | ||||||
Spring boot with domain driven design | ||||||||||
Compose Pay | 24 | 6 months ago | 1 | apache-2.0 | Java | |||||
:trident: HA distributed payment gateway. 高可用分布式支付网关/支付前置/支付系统/微信/支付宝 | ||||||||||
Paypal Springboot | 24 | 5 years ago | 2 | Java | ||||||
paypal payment sample using spring boot, paypal java SDK, thymeleaf | ||||||||||
Spring Boot Starter Wechatmp | 21 | 7 years ago | Java | |||||||
Spring Boot with Wechat Support |
Star
JavaV3Spring Boot StarterAPIAPIstar
<dependency>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot-starter</artifactId>
<version>1.0.17.RELEASE</version>
</dependency>
Open JDKFBI Warning
APIAPI
API
WechatPayV3Type
API
@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