setExpressCheckout 和 SSL/TLS 错误 [英] setExpressCheckout and SSL/TLS error

查看:18
本文介绍了setExpressCheckout 和 SSL/TLS 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个简单的应用程序,使用户能够通过 Paypal API 从网站购买服务.此应用程序使用 C# 在 ASP.NET 上运行.

I'm trying to develop a simple application that will enable users to purchase services off a website through the Paypal API. This application is running on ASP.NET with C#.

我在尝试与 Paypal API 合作时运气不佳.我正在调用的方法是带有所有适当变量的 SetExpressCheckout.

I have had very little luck trying to get the Paypal API to co-operate. The method I'm calling is SetExpressCheckout with all the appropriate variables.

我进行了研究,发现由于我是在 Localhost 中进行测试,因此可能会影响 Paypal 与应用程序进行通信的能力.因此,我接下来尝试的是通过开放端口和可公开访问的 IP 地址访问我的应用程序,但在调用 SetExpressCheckout 时发生了同样的错误.

I did my research and discovered that since I'm testing in Localhost, it may affect Paypal's ability to communicate with the application. So the next thing I tried was accessing my application through an open port and a publicly accessible IP address, but the same error occurs on the call to SetExpressCheckout.

这里是错误:

Exception Details: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.

Source Error: 


Line 1790:        [return: System.Xml.Serialization.XmlElementAttribute("SetExpressCheckoutResponse", Namespace="urn:ebay:api:PayPalAPI")]
Line 1791:        public SetExpressCheckoutResponseType SetExpressCheckout([System.Xml.Serialization.XmlElementAttribute(Namespace="urn:ebay:api:PayPalAPI")] SetExpressCheckoutReq SetExpressCheckoutReq) {
Line 1792:            object[] results = this.Invoke("SetExpressCheckout", new object[] {
Line 1793:                        SetExpressCheckoutReq});
Line 1794:            return ((SetExpressCheckoutResponseType)(results[0]));

Source File: c:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filesanan_p2730602d631a8d74eApp_WebReferences.c8vgyrf8.2.cs    Line: 1792 

我也尝试过使用 OpenSSL 生成证书并将它们上传到 Paypal 帐户的加密卖家选项,但仍然没有效果.

I've also tried generating certificates using OpenSSL and uploading them to the Paypal account's encrypted seller option but still no effect.

非常感谢您通读我的问题!

Thank you very much for reading through my question!

更新:这里要求的是正在使用的代码.

Update: As requested here is the code being used.

        String hostingOn = ConfigurationManager.AppSettings["default_site_url"];
        reqDetails.ReturnURL = hostingOn + "marketplace_confirm.aspx";
        reqDetails.CancelURL = hostingOn + "marketplace.aspx";
        reqDetails.NoShipping = "1";
        reqDetails.ReqConfirmShipping = "0";

        reqDetails.OrderTotal = new BasicAmountType()
        {
            currencyID = CurrencyCodeType.CAD,
            Value = payment_amt.Value,
        };

        SetExpressCheckoutReq req = new SetExpressCheckoutReq()
        {
            SetExpressCheckoutRequest = new SetExpressCheckoutRequestType()
            {
                Version = UtilPayPalAPI.Version,
                SetExpressCheckoutRequestDetails = reqDetails
            }

        };

        PayPalAPIAASoapBinding paypal = new PayPalAPIAASoapBinding();

        paypal.SetExpressCheckout(req);

我也在使用 https://api-aa-3t.paypal.com/2.0/ 访问 API 的 url

I am also using the https://api-aa-3t.paypal.com/2.0/ url for accessing the API

推荐答案

您可能正在连接到 api.paypal.com 或 api.sandbox.paypal.com,而不是发送您的 API 证书.API 证书是用于完成 SSL 链的客户端 SSL 证书.

You're probably connecting to api.paypal.com or api.sandbox.paypal.com, and not sending along your API certificate. The API certificate is a client SSL certificate used to complete the SSL chain.

如果您没有或未使用 API 证书,则应分别连接到 api-3t.paypal.com 或 api-3t.sandbox.paypal.com 以用于 Live 或 Sandbox.

If you don't have or are not using an API certificate, you should connect to api-3t.paypal.com or api-3t.sandbox.paypal.com for Live or Sandbox respectively.

这篇关于setExpressCheckout 和 SSL/TLS 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆