pingpp-java's People
Forkers
zodsoft funkyyang dericktang zcfrank1st yinheli kuner fencesky kingja01 zwhenry nireus-lee saberhao xmanapp cailin186 zilouzhang sunlida shenshen123jun norelax andy521 aadebuger yuqiaoo huyongliang wanshoo yjph83 lohasle yuanhongtao pighero001 nero520 zhaojunfu2014 nodeer finally-vince tornadory opskuba hank8345 liuyinhou lzqhelloworld orcaanewone jh2015forgit panlingyun msdgwzhy6 frankswu whhx steventsai fannyoo michaeljee mushroom1113 chongchong3515 guosenzhang jianchang653 vermouthgod ooclrickliu madman000 everhopingandwaiting 280455936 ke-liang mrxiong nanw01 jameswei zhangyaomin ajsky shuwang1234 icyframe markercup frank0417 fanliao hongzc hansen2014 jasonzhou1999 crosslee fqlee soundbus-technologies forcenamealex brantlisi zgx8510 vicklin yixiu123 linzy410 xnx3 honcho-cheng jasongeng88 clark4working heggychan ddtddtfun bajitanglang myqq156001980 wangmengzhong msdstest kinghubo mxy666 abaotb chaosbynn qinpo333 niudong2015 evgeniyp11 fx1061076658 fysuccess eshine123 is00hcw sjw903 shenzhenuletian zhaocanpingpp-java's Issues
PingppObject类中GsonBuilder注册registerTypeAdapter的疑问。
public static final Gson PRETTY_PRINT_GSON = new GsonBuilder()
.setPrettyPrinting()
.serializeNulls()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.disableHtmlEscaping()
.registerTypeAdapter(BatchTransferRecipientSerializer.class, new BatchTransferRecipientSerializer())
.registerTypeAdapter(BatchRefundCharges.class, new BatchRefundChargesSerializer())
.registerTypeAdapter(Double.class, new DoubleTypeSerializer())
.registerTypeAdapter(ChargeEssentials.class, new ChargeEssentialsSerializer())
.registerTypeAdapter(CouponTemplateExpiration.class, new CouponTemplateExpirationSerializer())
.registerTypeAdapter(SettleAccountRecipient.class, new SettleAccountRecipientSerializer())
.create();
这里的registerTypeAdapter(BatchTransferRecipientSerializer.class, new BatchTransferRecipientSerializer()是不是应该为: .registerTypeAdapter(BatchTransferRecipient.class, new BatchTransferRecipientSerializer())
jdk的版本问题
请问一下你们的java的jdk的版本支持多少?
我本机的jdk是1.6.02,运行你们的demo就出下面的版本不对的错误信息。
java.lang.UnsupportedClassVersionError: example/WxPubOAuthExample : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) Exception in thread "main"
无法从jcenter下载jar
因为jcenter已关闭,这么严重的问题没人管吗
charge对象创建成功后怎么办呢
这个地方有点迷啊。
用的server sdk。
创建成功后,也没返回一个支付的url啊。
jcenter 替换aliyun镜像源
buildscript {
repositories {
maven {
url 'https://maven.aliyun.com/repository/central'
}
mavenLocal()
mavenCentral()
}
}
allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/central'
}
mavenLocal()
mavenCentral()
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile 'com.google.code.gson:gson:2.8.5'
compile 'commons-codec:commons-codec:1.10'
testCompile 'junit:junit:4.12'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'Pingplusplus'
artifactId 'pingpp-java'
pom.withXml {
def root = asNode()
root.appendNode('name', 'pingpp-java')
root.appendNode('url', 'https://github.com/PingPlusPlus/pingpp-java')
}
}
}
}
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("pom.xml")
}
}
SDK 代码许可协议是啥?
如题。LGPL?MIT?Apache?BSD?
阿里云jcenter失效
无法下载依赖
建议创建Charge对象的时候,写一个支持把apiKey当作参数传进去的重载方法,因为有时候apiKey不唯一(多个收款商家的情况下)
请求体解析失败: 不是一个合法的 json 格式字符串
直接复制官网给出的示例代码,使用gradle引入sdk后,Charge.create一直调试不通,给出异常信息如下:
com.pingplusplus.exception.InvalidRequestException: Error type: invalid_request_error
Error message: 请求体解析失败: 不是一个合法的 json 格式字符串
at com.pingplusplus.net.APIResource.handleAPIError(Unknown Source)
at com.pingplusplus.net.APIResource.request(Unknown Source)
at com.pingplusplus.model.Charge.create(Unknown Source)
跟踪调试发现,APIResource.createJSONString一直返回null
//sdk中序列化部分代码
Gson gson = new GsonBuilder().enableComplexMapKeySerialization().create();
logger.debug(gson.toJson(chargeParams)); //输出null
logger.debug(JSONUtils.toJson(chargeParams));
//输出:{"order_no":"1bo6u5e010001","app":{"id":"adfaadfasdfads"},"amount":100,"subject":"adfadf","channel":"alipay","client_ip":"127.0.0.1","currency":"cny","body":"1bo9mv9010001"}
烦请确认!
`
创建 Refund 对象,怎么不能传商户自己的退款单号?
如果创建 Refund 对象超时,并不幂等,只能根据Charge分页查询获取最新的Refund对象,但是是部分退款,获取到了最新的Refund对象,还只能通过金额去判断大概是不是这个Refund对象。如果差不多先后时间,有其他业务操作也是创建了相同金额的Refund对象。
那么有可能就会存在误判,认为这个Refund对象是之前超时请求创建的。
本来先后有两个业务都退了5块钱,其中一个超时网络异常,实际并没有请求成功,但是查询了一次发现其他业务创建的Refund对象,则会存在误认为自己退款成功
。
B-----> Create Refund对象, 退款5元,创建成功。
B-----> Create Refund对象, 退款5元,创建失败,因为网络超时,实际ping++并没有收到请求,
这边流程会根据Charge对象去查询Refund对象列表,发现刚才已经创建成功了一个Refund对象 也是退款5元,因为没有其他信息只能根据金额。
不然描述description字段保存退款单号。。。
如果 apiKey 需要在程序中有多个应该怎么做?
万一我要在程序中使用会有多个apiKey 配置,那需要怎么做?我看到 sdk 里面是写成 static 的,所以想问下。
sdk 不能下载了
https://jcenter.bintray.com/Pingplusplus/pingpp-java/ 这个地址不能访问了 403 Forbidden
java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: xxx. Forgot to register a type adapter?
java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: xxx. Forgot to register a type adapter?
Map<String, Object> hashMap = new PropertyUtilsBean().describe(this); c = Charge.create(hashMap);
使用PropertyUtilsBean将javabean转换成map之后调用create报错
加入lovemode参数后报错
chargeParams.put("livemode", "false");
冒昧的问一下?代码为啥要这样写?
是基于什么来设计的?为啥我感觉很混乱
流程接入说明吗?
您好,第一次接触这个东西,想调研一下贵公司产品,看文档有点懵,咱们这个有流程接入说明吗?或者大概怎么深入了解?
when using gson 1.7.1.jar there has an exception,but i have to use this version.
com.google.gson.JsonParseException: Type information is unavailable, and the target object is not a primitive: {xxxxx"}
at com.google.gson.JsonObjectDeserializationVisitor.visitPrimitive(JsonObjectDeserializationVisitor.java:130) at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:116)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.MapTypeAdapter.deserialize(MapTypeAdapter.java:68)
at com.google.gson.MapTypeAdapter.deserialize(MapTypeAdapter.java:33)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:521)
at com.pingplusplus.net.ChargeDeserializer.deserialize(ChargeDeserializer.java:48)
at com.pingplusplus.net.ChargeDeserializer.deserialize(ChargeDeserializer.java:20)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:80)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:101)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:498)
at com.google.gson.Gson.fromJson(Gson.java:467)
at com.google.gson.Gson.fromJson(Gson.java:417)
at com.google.gson.Gson.fromJson(Gson.java:389)
at com.pingplusplus.net.APIResource.request(APIResource.java:518)
at com.pingplusplus.model.Charge.create(Charge.java:274)
at cxj.manage.action.tradeEpay.PingPPChargeServ.charge(PingPPChargeServ.java:56)
at cxj.manage.action.tradeEpay.TradeEpayController.ePayPre(TradeEpayController.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at cxj.manage.utils.BaseDispatcherServlet.doService(BaseDispatcherServlet.java:32)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
创建charge对象subject传入中文
银联接口 创建charge对象subject传入中文时报签名错误
不支持jdk1.7的版本
jar包2.3.1不支持jdk1.7的版本
支付宝H5支付,服务端创建Charge为何要填写发起请求的ip?
如题,我接过支付宝官方的wap支付,也没说还要传客户端ip啊?
另外我测试一直提示这个:
错误代码 insufficient-isv-permissions 错误原因: ISV权限不足,建议在开发者中心检查对应功能是否已经添加,解决办法详见:
https://docs.open.alipay.com/common/isverror
是我ip地址填错(我填的127.0.0.1)?我看 https://pingplusplus.kf5.com/hc/kb/article/1041961/ 这个地址说请登录支付宝检查签约产品是否已生效,关键是我是接的ping++,不是直接接支付宝啊,怎么还要我自己登支付宝去查看呢?
example中的验签结果是失败的啊
你们确实这是成功的?
使用sdk创建charge出错
com.pingplusplus.exception.InvalidRequestException: 没有提供签名串,需要在 header 中加入签名串。; type: invalid_request_error
com.pingplusplus.exception.InvalidRequestException: 没有提供签名串,需要在 header 中加入签名串。; type: invalid_request_error
at com.pingplusplus.net.APIResource.handleAPIError(APIResource.java:248)
at com.pingplusplus.net.APIResource.request(APIResource.java:209)
at com.pingplusplus.model.Charge.create(Charge.java:284)
2.1.6以上的SDK,用maven编译时 会因为gson用了新版本,Java的版本强制要求1.8
"Invalid JDK version in profile
'doclint-java8-disable'
Sanjivkumarroshan/google-gson#588
建议把gson版本降到2.2.4
com.google.gson.JsonParseException: Type information is unavailable, and the target object is not a primitive
demo直接运行Main方法,一直报错,如下,第一次集成这个支付,好无力,求大神解答,
警告: Overriding the existing type handler for interface java.util.Map
Exception in thread "main" com.google.gson.JsonParseException: Type information is unavailable, and the target object is not a primitive: {"orderInfo":"_input_charset="utf-8"&body="Your Body"&it_b_pay="2016-06-03 16:31:15"¬ify_url="https%3A%2F%2Fapi.pingxx.com%2Fnotify%2Fcharges%2Fch_yHS0CC4qTerDmznHWLj5WHKC"&out_trade_no="1464856241617rbrm4vv"&partner="2008536698119845"&payment_type="1"&seller_id="2008536698119845"&service="mobile.securitypay.pay"&subject="Your Subject"&total_fee="1.00"&sign="UG1EdVBTTGF2TEdLNW1UaTUweWZmYnJQ"&sign_type="RSA""}
at com.google.gson.JsonObjectDeserializationVisitor.visitPrimitive(JsonObjectDeserializationVisitor.java:130)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:116)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.MapTypeAdapter.deserialize(MapTypeAdapter.java:68)
at com.google.gson.MapTypeAdapter.deserialize(MapTypeAdapter.java:33)
Disconnected from the target VM, address: '127.0.0.1:58520', transport: 'socket'
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117)
at com.google.gson.ReflectingFieldNavigator.visitFieldsReflectively(ReflectingFieldNavigator.java:63)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:120)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:521)
at com.pingplusplus.net.ChargeDeserializer.deserialize(ChargeDeserializer.java:49)
at com.pingplusplus.net.ChargeDeserializer.deserialize(ChargeDeserializer.java:20)
at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
at com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:80)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:101)
at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:76)
at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:54)
at com.google.gson.Gson.fromJson(Gson.java:551)
at com.google.gson.Gson.fromJson(Gson.java:498)
at com.google.gson.Gson.fromJson(Gson.java:467)
at com.google.gson.Gson.fromJson(Gson.java:417)
at com.google.gson.Gson.fromJson(Gson.java:389)
at com.pingplusplus.net.APIResource.request(APIResource.java:543)
at com.pingplusplus.model.Charge.create(Charge.java:274)
at com.pingxx.example.ChargeExample.createCharge(ChargeExample.java:71)
at com.pingxx.example.ChargeExample.runDemos(ChargeExample.java:37)
at com.pingxx.example.Main.main(Main.java:48)
pingpp-java.2.1.0 not found
I fail to down the version 2.1.0.
http://jcenter.bintray.com/Pingplusplus/pingpp-java/2.1.0/pingpp-java-2.1.0.jar
But I can down the version 2.0.10.
Please advice which version to use.
ping++ Server SDK未来会有Scala版本吗?
您好,请问未来会有Scala
版本的Server SDK
吗?
目前sbt
里面如何引入Server SDK
呢?
谢谢
工程既然是maven结构的,src中却没有pom.xml
请添加pom.xml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.