简体   繁体   English

贝宝-获取令牌沙箱

[英]PAYPAL - get token sandbox

public void init(ServletConfig servletConfig) throws ServletException {

        try {

            OAuthTokenCredential tokenCredential = PayPalResource.initConfig(new File(PaypalServlet.class.getResource("sdk_config.properties").getPath()));
            accessToken = tokenCredential.getAccessToken();

        } catch (PayPalRESTException e) {

            LOGGER.fatal(e.getMessage());
        }catch (Exception e) {
            LOGGER.fatal(e.getMessage());
        }
    }

I am Using the above code for getting an access token. 我正在使用上面的代码来获取访问令牌。 if i enter the paypal credentials it works fine. 如果我输入贝宝凭据,则可以正常工作。 However if i change the credentials those of sandbox to test, access token is null. 但是,如果我更改要测试的沙箱凭据,则访问令牌为null。 I have verified that the credentials for sandbox are right by using curl. 我已经通过使用curl验证了沙箱的凭据正确。 is there anything i might be missing for testing with sandbox? 使用沙箱进行测试可能会缺少什么吗?

Pls check our server error logs and looking for SSL connection failures, it looks the underlying connection did not setup. 请检查我们的服务器错误日志并查找SSL连接失败,看起来基础连接未建立。 (otherwise there should be an API error returned from PayPal) (否则,PayPal应该返回API错误)

PayPal sandbox has been upgraded to accept TLSv1.2 only as the SSL connections protocol, so make sure your server environment components are compliant. PayPal沙箱已升级为仅接受TLSv1.2作为SSL连接协议,因此请确保您的服务器环境组件兼容。 Please see language specific checking instructions HERE 请在此处查看特定语言的检查说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM