ssl - (400)PayPalAPISoapBindingStub.transactionSearch 中的错误请求

标签 ssl paypal paypal-soap

在使用 paypal SOAP API (TransactionSearch) 发生 SSLHandshakeException 后,我已将 paypal_base.jar 更新为 paypal 在以下链接中指示的版本:

https://github.com/paypal/TLS-update

我已经解决了这个问题,但是我有以下问题:

mar 31, 2016 6:56:26 PM com.paypal.sdk.core.soap.SOAPAPICaller call
INFORMACIÓN: transactionSearch sent
mar 31, 2016 6:56:28 PM com.paypal.sdk.exceptions.TransactionException <init>
GRAVE: (400)Bad Request
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.paypal.sdk.core.soap.SOAPAPICaller.callSOAP(SOAPAPICaller.java:462)
at com.paypal.sdk.core.soap.SOAPAPICaller.call(SOAPAPICaller.java:382)
at com.paypal.sdk.services.CallerServices.call(CallerServices.java:125)
at t.main(t.java:42)
Caused by: (400)Bad Request
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.paypal.soap.api.PayPalAPISoapBindingStub.transactionSearch(Unknown Source)
... 8 more

关于这个问题有什么线索吗?

更新:

这是请求:

TransactionSearchRequestType request = new TransactionSearchRequestType();
    request.setStartDate(new GregorianCalendar());

    CallerServices caller = new CallerServices();
    try {
        APIProfile profile = ProfileFactory.createSignatureAPIProfile();
        profile.setAPIUsername("*********");
        profile.setAPIPassword("*************");
        profile.setSignature("*******************************************");
        profile.setEnvironment("sandbox");
        caller.setAPIProfile(profile);

        TransactionSearchResponseType response = (TransactionSearchResponseType) caller.call("TransactionSearch", request);

    } catch (PayPalException e) {
        System.out.println("PaypalCaller: Error calling Paypal webservice " + e);
    } catch (Exception e) {
        System.out.println(e.getMessage() + e);
    } catch (Throwable e) {
        System.out.println(e.getMessage() + e);
    }

最佳答案

我能够解决问题。我使用了另一个可用于执行相同操作的 paypal 库:

https://github.com/paypal/merchant-sdk-java

代码:

TransactionSearchReq txnreq = new TransactionSearchReq();
TransactionSearchRequestType requestType = new TransactionSearchRequestType();
    requestType.setStartDate("2016-03-28T00:00:00.000Z");
    txnreq.setTransactionSearchRequest(requestType);

    PayPalAPIInterfaceServiceService service;

    try {
        Map<String, String> sdkConfig = new HashMap<String, String>();

        sdkConfig.put("mode", "sandbox");
        sdkConfig.put("acct1.UserName", "***********");
        sdkConfig.put("acct1.Password", "***************");
        sdkConfig.put("acct1.Signature","*****************************");

        service = new PayPalAPIInterfaceServiceService(sdkConfig);
        TransactionSearchResponseType response = service.transactionSearch(txnreq);

    } catch (Exception e) {
        e.printStackTrace();
    }

关于ssl - (400)PayPalAPISoapBindingStub.transactionSearch 中的错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36337973/

相关文章:

node.js - 使用 Node.js 加密发送的内容

wordpress - 如何使用 CloudFront 为 EC2 实例设置 SSL (Wordpress)

angular - 在 Angular 6 中实现 Paypal

php - Paypal 不通知我的 IPN 监听器

paypal - 测试 PayPal 付款未显示在沙箱中

Paypal :取消或超时付款

ssl - 连接错误后获取证书信息

python-requests:是否可以绕过 HTTPS 以提高速度

Paypal Adaptive - 三种支付方式

c#-4.0 - 如何在 Paypal SOAP API 快速结帐中设置运费