GithubHelp home page GithubHelp logo

egzosn / pay-java-parent Goto Github PK

View Code? Open in Web Editor NEW
2.7K 142.0 911.0 11.16 MB

第三方支付对接全能支付Java开发工具包.优雅的轻量级支付模块集成支付对接支付整合(微信,支付宝,银联,友店,富友,跨境支付paypal,payoneer(P卡派安盈)易极付)app,扫码,网页刷脸付刷卡付条码付转账服务商模式,微信分账,微信合单支付、支持多种支付类型多支付账户,支付与业务完全剥离,简单几行代码即可实现支付,简单快速完成支付模块的开发,可轻松嵌入到任何系统里 目前仅是一个开发工具包(即SDK),只提供简单Web实现,建议使用maven或gradle引用本项目即可使用本SDK提供的各种支付相关的功能

License: Apache License 2.0

Java 99.23% HTML 0.77%
pay alipay wxpay youdian fuiou paypal payoneer

pay-java-parent's People

Contributors

1787009158 avatar actinian avatar cnzzs avatar egaon avatar egzosn avatar faymanwang avatar hocgin avatar langlearn avatar menjoe-z avatar yangfuhai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pay-java-parent's Issues

一码付的问题

有没有商户提供一个静态二维码,这个二维码支持微信和支付宝同时扫码支付的列子?

签名错误

一直说前面错误,wxPayConfigStorage.setSignType(SignUtils.HMACSHA256.name());这是设置的签名

DateUtils#minutesRemaining

这个工具类,因为订单到支付会有那么几秒的时间差,因此直接算超时时间的话会导致支付宝订单超时时间少了一分钟。
if (null != order.getExpirationTime()) { long round = Math.round((order.getExpirationTime().getTime() - System.currentTimeMillis()) / 1000d / 60); bizContent.put("timeout_express", round + "m"); }

二维码支付Connection reset

qq 20180206102650

沙箱环境在支付一次之后无法正常调用二维码了,一直出Connection reset。必须重启项目才行,请问这个是配置问题还是什么问题呢?

getSecretKey报错问题

您好,pay-java-ali项目,有继承方法:com.egzosn.pay.ali.api.AliPayConfigStorage.getSecretKey(),但是这个方法在deprecated类com.egzosn.pay.common.before.api.PayConfigStorage,请问怎么处理这个报错问题呀?

企业付款api商户号参数有bug

最后看了下是mch_id参数有误 并且没有可以供设置提现ip的方法 这个接口必须要传递ip参数 微信官方文档是
image
image

这个库里提交的商户号参数是这个
image

mchid 和 mch_id 作者这个库里多了个_

HttpRequestTemplate这个类的doExecute方法异常没有抛出;能不能使用http连接池

1、HttpRequestTemplate这个类的doExecute方法异常没有抛出,也没有打日志,不方便调试
public T doExecute(URI uri, Object request, Class responseType, MethodType method){
ClientHttpRequest httpRequest = new ClientHttpRequest(uri ,method, request);
//判断是否有代理设置
if (null == httpProxy){
httpRequest.setProxy(httpProxy);
}
httpRequest.setResponseType(responseType);
try (CloseableHttpResponse response = httpClient.execute(httpRequest)) {
return httpRequest.handleResponse(response);
}catch (IOException e){
e.printStackTrace();
}finally {
httpRequest.releaseConnection();
}
return null;
}

2、能不能使用http连接池

微信退款 证书都设置了怎么会提示这个 支付错误: errcode=IOException, errmsg=api.mch.weixin.qq.com:443 failed to respond

支付错误: errcode=IOException, errmsg=api.mch.weixin.qq.com:443 failed to respond

    WxPayConfigStorage wxPayConfigStorage = new WxPayConfigStorage();
    wxPayConfigStorage.setMchId(mchid);
    wxPayConfigStorage.setAppid(appid);
    wxPayConfigStorage.setSecretKey(machKey);
    wxPayConfigStorage.setSignType("HMAC-SHA256");
    wxPayConfigStorage.setInputCharset("utf-8");
    HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
    httpConfigStorage.setKeystore("MIIEvwI.......");
    httpConfigStorage.setStorePassword("1218......");

    httpConfigStorage.setPath(false);
    WxPayService service = new WxPayService(wxPayConfigStorage, httpConfigStorage);
    RefundOrder order = new RefundOrder("420000....", "", new BigDecimal(0.01), new BigDecimal(0.01));
    order.setRefundNo("zsdopadopasd123");
    Map result = service.refund(order);

银联支付初始化时空指针

UnionPayConfigStorage unionPayConfigStorage = buildUnionPayConfig();
PayService service = new UnionPayService(unionPayConfigStorage);

new UnionPayService的时候空指针,在截图的85行。
除非设置 unionPayConfigStorage.setCertSign(false); 才不会走到这行初始化。但是证书签名设置为false以后,下单的接口里面又调用的证书相关的代码,又报了空指针……

image

完全按照文档操作的,不知道哪边出错了。有空请告知,感谢!

微信沙箱环境退款报错

截屏2020-04-01下午3 08 07

截屏2020-04-01下午3 08 42

你好, 用你的工具包,微信支付在沙箱环境调好了, 但 退款报错, 沙箱环境也得需要证书吗? 我没弄证书,准确来说现在弄不到证书,不是不想弄

微信支付两个问题

JSAPI情况下
返回的参数key是 "sign" 实际应为paySign 否则就要自己前端转一下,
沙盒测试一直报错xml格式不正确, 将请求的xml 自己写http请求就没问题,排除组装的问题,怀疑是不是http工具类哪里处理有问题

paypal的sandbox环境配置后端回调接口的问题

请问大佬,paypal的sandbox环境配置后端回调接口是在webhooks里配置吗?sandbox环境的地址必须是是https的吗?http不可以吗?我支付了之后前端跳转了页面,但是后端没有被调用。

支付宝APP支付 使用RSA2签名错误

调用APP支付组装信息 app端使用sdk调用支付宝支付,返回系统繁忙错误

问题:用官方sdk会存在一个参数alipay_sdk 但使用作者的没有 是不是这个原因引起的??? 我把现有签名串与官方工具签名对比结果一致 但还是出现签名错误,望大手解答

错误信息:
{"alipay_trade_app_pay_response":{"code":"40002","msg":"Invalid Arguments","sub_code":"isv.invalid-signature","sub_msg":"验签出错,建议检查签名字符串或签名私钥与应用公钥是否匹配,网关生成的验签字符串为:app_id=2017051607253746&biz_content={"body":"私人订单","out_trade_no":"8a12595241b6479c9ed9d4d1649310b4","product_code":"QUICK_MSECURITY_PAY","seller_id":"2088621830719584","subject":"私人订单单","total_amount":"0.03"}&charset=utf-8&format=json&method=alipay.trade.app.pay&notify_url=https:\/\/customer-beta.emeik.cn\/api\/customer\/ali_pay\/app\/notify\/down_payment&return_url=&sign_type=RSA2&timestamp=2019-05-09 18:04:33&version=1.0"}}

微信退款不支持自定义参数,可选参数无法传入,自定义参数问题

支付宝退款:alipay.trade.refund(统一收单交易退款接口)

这个接口里,我想使用里面的参数:query_options,传一个"refund_detail_item_list"

但看了下refund方法,没看到该参数的传入,想通过重写AliPayService的方法达到目的,但是里面各种方法,都是私有的,包括Map类型的bizContent也是局部变量,这样就无法传入哪些可选但某些情况下有用的参数了

可以考虑新增一个接口专门用来参数拓展吗,类似参数后置处理的方式
或者别的方式,比如将sevice支持定制(重写)的内容,抽象至abstractPay,方法修饰符为protected,一些特定的,默认的 用defaultPayService来实现,这样一来就可自行实现,选择性的进行定制service的组成

还有一个小小的请求,微信的退款回调 我想回调另外一个地址,因为逻辑放一起太混乱了,我看微信payService的refund方法里,是直接获取原先配置的notifyUrl了,这样我就没法自定义其他notifyUrl了,不知道可否支持自定义一下?

2.13.2版本 微信退款无法自定义参数 方法实现里没使用到attr

Exception in thread "main" java.lang.IllegalArgumentException: No enum constant com.egzosn.pay.common.util.sign.SignUtils.签名方式

Exception in thread "main" java.lang.IllegalArgumentException: No enum constant com.egzosn.pay.common.util.sign.SignUtils.签名方式
at java.lang.Enum.valueOf(Unknown Source)
at com.egzosn.pay.common.util.sign.SignUtils.valueOf(SignUtils.java:1)
at com.egzosn.pay.common.api.BasePayService.createSign(BasePayService.java:101)
at com.egzosn.pay.ali.api.AliPayService.setSign(AliPayService.java:138)
at com.egzosn.pay.ali.api.AliPayService.orderInfo(AliPayService.java:155)
at com.egzosn.pay.ali.api.AliPayService.genQrPay(AliPayService.java:276)
at PayTest.main(PayTest.java:44)

微信支付设置过期时间问题

微信支付开发文档描述:
订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。

com.egzosn.pay.wx.api.WxPayService
59 private final static DateFormat df = new SimpleDateFormat("yyyyMMddHHmms");
这个时间格式会导致如果过期时间的秒位是0-9,时间格式不合法,无法生成二维码,,,

如何获取请求和响应参数?

作者您好,感谢你开发这个统一的聚合支付 SDK~

我们调用支付宝或微信支付的接口时候,请求有 URL 和参数,响应也是有响应体的,我想记录这些信息到数据库方便以后排错、查询问题,目前在 API 中无法直接获取这些信息、

我的想法是把一切信息都存储在返回参数上,用不同类型的参数来完成不同接口的调用。如扫码付里的 BufferedImage 就可以封装在该返回参数中,将请求的 URL 和参数也放在这个响应里,这样方便获取。

其他的源码我还没看,有时间的话会提 PR 的,不过想听听你的设计思路和规划是怎样的。

微信退款不支持自定义参数,可选参数无法使用

支付宝退款:alipay.trade.refund(统一收单交易退款接口)

这个接口里,我想使用里面的参数:query_options,传一个"refund_detail_item_list"

但看了下refund方法,没看到该参数的传入,想通过重写AliPayService的方法达到目的,但是里面各种方法,都是私有的,包括Map类型的bizContent也是局部变量,这样就无法传入哪些可选但某些情况下有用的参数了

可以考虑新增一个接口专门用来参数拓展吗,类似参数后置处理的方式
或者别的方式,比如将sevice支持定制(重写)的内容,抽象至abstractPay,方法修饰符为protected,一些特定的,默认的 用defaultPayService来实现,这样一来就可自行实现,选择性的进行定制service的组成

还有就是,微信的退款回调 我想回调另外一个地址,因为逻辑放一起太混乱了,我看微信payService的refund方法里,是直接获取原先配置的notifyUrl了,这样我就没法自定义其他notifyUrl了,不知道可否支持自定义一下?

2.13.2版本 微信退款无法自定义参数 方法实现里没使用到attr

payonner的API是需要开通批量支付吗

官网并没有有关API的内容
configStorage.setUserName("PayoneerPay 用户名");
configStorage.setApiPassword("PayoneerPay API password");
其中的UserName和Password是哪里能够找到
请问这个批量支付开通有没有什么要求/如何开通
十分感谢

统一下单bug

微信支付文档中关于统一下单的部分:必须满足“以下字段在return_code 和result_code都为SUCCESS的时候有返回”,才能返回prepay_id 和 trade_type。因此WxPayService.verify L111只判断return_code,是不是不妥。这就导致有的情况下没有prepay_id,导致APP不能拉起微信

https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_1

使用paypal支付发现问题

hi
我使用paypal支付成功后,长时间不使用,下次下单时会报错

Invalid cookie header: "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D1880%26app%3Dapiplatformproxyserv%26TIME%3D1728032604%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 12 Apr 2019 03:30:54 GMT; domain=.paypal.com; path=/; Secure; HttpOnly". Invalid 'expires' attribute: Fri, 12 Apr 2019 03:30:54 GMT
2019-04-12 03:00:54.719  WARN 5 --- [  XNIO-1 task-8] o.a.h.c.p.ResponseProcessCookies         : Invalid cookie header: "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT". Invalid 'expires' attribute: Thu, 01 Jan 1970 00:00:01 GMT

orderInfo里没有发现id

是否是cookies过期所致,我可以手动关闭cookies吗?

使用版本 2.12.6

谢谢

Fastjson 问题

can not get javaBeanDeserializer. com.alibaba.fastjson.JSONObject

JsonObject.toJavaObject(T(JSONObject)) 导致解析出错

支付请求连接超时设置?优化

是否考虑增加超时设置
CloseableHttpClient httpClient = HttpClients
.custom()
//网络提供者
.setDefaultCredentialsProvider(createCredentialsProvider(configStorage))
//设置httpclient的SSLSocketFactory
.setSSLSocketFactory(createSSL(configStorage))
.setConnectionManager(connectionManager(configStorage))
.setDefaultRequestConfig(createRequestConfig(configStorage))
.build();

RequestConfig createRequestConfig(HttpConfigStorage configStorage){
//设置请求和传输超时时间
// setConnectionRequestTimeout 设置从connect Manager(连接池)获取Connection 超时时间,单位毫秒。这个属性是新加的属性,因为目前版本是可以共享连接池的。
RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(configStorage.getSocketTimeout())
.setConnectTimeout(configStorage.getConnectTimeout())
// .setConnectionRequestTimeout(1000)
.build();
return requestConfig;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.