pay-group / best-pay-sdk Goto Github PK
View Code? Open in Web Editor NEW可能是最好的支付SDK
可能是最好的支付SDK
是否支持沙箱配置?以便于在开发环境测试
就把demo里面的三个java文件拷过来了,然后配置文件自己建了个.properties文件,除了读取配置文件,其他代码都没动
修复方案:
XmlUtil.java
line 65:
Map<String, String> data = new HashMap<>();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
//防止xxe攻击
documentBuilderFactory.setExpandEntityReferences(false);
String FEATURE = null;
try {
FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
documentBuilderFactory.setFeature(FEATURE, true);
FEATURE = "http://xml.org/sax/features/external-general-entities";
documentBuilderFactory.setFeature(FEATURE, false);
FEATURE = "http://xml.org/sax/features/external-parameter-entities";
documentBuilderFactory.setFeature(FEATURE, false);
documentBuilderFactory.setXIncludeAware(false);
documentBuilderFactory.setExpandEntityReferences(false);
} catch ( Exception e) {
logger.info("微信异步通知解析文件出错:原因:{}" + ExcepitonUitl.printErrorTrace(e) );
e.printStackTrace();
}
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8"));
org.w3c.dom.Document doc = documentBuilder.parse(stream);
doc.getDocumentElement().normalize();
NodeList nodeList = doc.getDocumentElement().getChildNodes();
....................
/**
* H5支付交易类型选择
*/
public String switchH5TradeType(BestPayTypeEnum payTypeEnum){
String tradeType = "JSAPI";
switch (payTypeEnum){
case WXPAY_H5:
tradeType = "JSAPI";
break;
case WXPAY_MWEB:
tradeType = "MWEB";
break;
}
return tradeType;
}
目前是分散的,需要统一
在WxPayServiceImpl.java中的以下代码,微信订单未支付的情况下timeEnd会返回空,以下代码会抛出空指针异常
return OrderQueryResponse.builder()
.orderStatusEnum(OrderStatusEnum.findByName(response.getTradeState()))
.resultMsg(response.getTradeStateDesc())
.outTradeNo(response.getTransactionId())
.orderId(response.getOutTradeNo())
.attach(response.getAttach())
//yyyyMMddHHmmss -> yyyy-MM-dd HH:mm:ss
.finishTime(response.getTimeEnd().replaceAll("(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3 $4:$5:$6"))
.build();
版本 1.3.1
源码中处理异步回调时,先把数据URLDecoder,再调用MapUtil.form2Map,
实际调用时,发现支付宝返回的签名(sign)上有“=”这样的字符串,form2Map方法里面,有按照“=”切割的代码,转换为map的签名少了“=”,导致签名验证失败
建议先按“&”分割,再URLDecoder
师兄,支付宝退款好像没写?
增加web界面
都是按照文档赋值的,为什么返回结果是xml 参数错误呢?
MoneyUtil.Yuan2Fen 1.67 1.68 2.68都转成了 166分 167分 267分的问题
项目急用,支付宝退款没有写,退款的异步通知都没接啊,好纠结,用了一半
近期开发项目时需要退款申请后,需要接受到微信的异步通知,老师1.1版本里没有这个接口。就上来看看,我看到老师近期提交的有【新增微信加解密-退款通知,未测试】字眼,请问老师这个功能可以使用了吗?
java.lang.RuntimeException: 【微信统一支付】发起支付, returnCode != SUCCESS, returnMsg = appid and openid not match
你好,我想问一下,我最近在使用你们的这个jdk,但我在使用的时候,当调用bestPayService.pay(payRequest);方法时,能支付成功,但过了一会,它又会调用我的pay方法,也就是它自行调用了两次,因为第一次支付成功了,修改了订单状态,所以第二次调用时就会报错:java.lang.RuntimeException: 【微信统一支付】发起支付, resultCode != SUCCESS, err_code = ORDERPAID err_code_des=该订单已支付,但我就调用一次而已,结果它又调用了一次,也就是又进入了我调用pay方法的那个方法里,您可以帮我解答一下么,麻烦了。
建议使用微信官方的:WXPayUtil.isSignatureValid(notifyData, key);
支付宝支付AliPayServiceImpl retrofit写死了网关地址 , 使用沙盒访问的也是正式的地址
我引入1.1.0版本或者1.2.0版本都没有订单查询这一块的代码。但是我看这个github上多了一个订单查询的接口,但是我们mavan引入的代码没有这个接口
退款以后一直在回调“支付回调”接口
我看wxpay 在BestPayServiceImpl有调用set环境之后 pay。
但是alipay是如何调用和配置的呢
fix bug: 元转分使用double丢失精度, 应先转成String
但是直接用maven依赖:
cn.springboot
best-pay-sdk
1.1.0
系统是用的best-pay-sdk-1.1.0 , 能告诉一下怎么处理这个XXE漏洞吗?
以下是通知原文:
微信支付在发送支付结果通知中发现贵公司有一个安全漏洞, 请转给贵公司技术人员或系统提供商第一时间修复处理。【漏洞详情】:http://url.cn/5bNFX9o
网络安全漏洞直接影响贵公司业务开展,甚至导致资金损失。提前发现和修复漏洞,避免贵公司系统遭受黑客攻击。
为保证用户资金安全,微信支付将于2018年10月25日对仍未修复的商户采取暂停交易权限的措施。如有疑问,请通过邮箱 [email protected] 申请技术协助。感谢支持,微信支付与您共建安全支付。
看你里面有alipay, 还不能使用吗?
支付宝什么时候支持
/**
* 沙箱测试
/
String ALIPAY_GATEWAY_OPEN_DEV = "https://openapi.alipaydev.com/gateway.do";
/*
* 沙箱测试
*/
String ALIPAY_GATEWAY_OPEN_DEV = "https://openapi.alipaydev.com";
多了一級
这个字符支持支付宝吗
就算最后你用BigDecimal,参数传的是double也是存在精度问题的,建议换成String,或者都改成BigDecimal
统一成一个项目
java.lang.RuntimeException: RSAcontent = app_id=2021001109608476&biz_content={"out_trade_no":"1580536191235","total_amount":"0.1","subject":"测试阿里支付","product_code":"FAST_INSTANT_TRADE_PAY"}&charset=utf-8&method=alipay.trade.page.pay¬ify_url=xxx&sign_type=RSA2×tamp=2020-02-01 13:50:12&version=1.0; charset = utf-8
应该把错误类型抛出来的
�统一下单不能传订单交易结束时间?
微信支付验证签名失败,有使用红包的时候验证都是失败的
我的spring boot项目采用undertow容器,而不是默认的tomcat容器。结果在使用websocket过程中,老是报错。后面发现,原来best-pay-sdk有依赖tomcat容器。切换回tomcat就正常了。
一个支付的sdk为什么要绑死tomcat呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.