简体   繁体   English

Express PayPal结帐,无法创建SSL / TLS安全通道

[英]Express PayPal checkout, Could not create SSL/TLS secure channel

I'm trying set up paypal express checkout using SOAP 2.0 API in ASP.NET C# code. 我正在尝试使用ASP.NET C#代码中的SOAP 2.0 API设置贝宝快速结帐。 First I try to use sandbox, I created seller/buyer test accounts, imported web service and then I try to get token, in my C# code I have: 首先,我尝试使用沙箱,创建了卖方/买方测试帐户,导入了Web服务,然后尝试在我的C#代码中获得令牌:

        // Create the request object
        SetExpressCheckoutRequestType pp_request = new SetExpressCheckoutRequestType();

        // Create the request details object
        pp_request.SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();
        pp_request.SetExpressCheckoutRequestDetails.PaymentAction = paymentAction;
        pp_request.SetExpressCheckoutRequestDetails.PaymentActionSpecified = true;

        pp_request.SetExpressCheckoutRequestDetails.OrderTotal = new BasicAmountType();

        pp_request.SetExpressCheckoutRequestDetails.OrderTotal.currencyID = currencyCodeType;
        pp_request.SetExpressCheckoutRequestDetails.OrderTotal.Value = paymentAmount;

        pp_request.SetExpressCheckoutRequestDetails.CancelURL = cancelURL;
        pp_request.SetExpressCheckoutRequestDetails.ReturnURL = returnURL;

        SetExpressCheckoutResponseType response = (SetExpressCheckoutResponseType) caller.Call("SetExpressCheckout", pp_request);

but on the last line of that code it throws an error: 但是在该代码的最后一行,它将引发错误:

The request was aborted: Could not create SSL/TLS secure channel. 该请求已中止:无法创建SSL / TLS安全通道。

That I'm doing wrong? 我做错了吗? Thanks. 谢谢。

Your code certainly seems correct but the PayPal API can be finicky when it comes to a few things. 您的代码当然看起来是正确的,但是在涉及到一些事情时,PayPal API可能有些挑剔。 One thing to look out for is that it will generate exceptions when the payment amount is not rounded to 2 decimal places - can you try ensuring this is the case? 需要注意的一件事是,当付款金额未四舍五入到小数点后两位时,它将生成异常-您可以尝试确保是这种情况吗?

Also ensure that your configuration values are correct. 另外,请确保您的配置值正确。 Aside from that the code you have posted is exactly what I used to use for the SOAP API. 除此之外,您发布的代码正是我以前用于SOAP API的代码。

I stopped using the SOAP API a while ago in favour of the NVP API, which in my mind is a bit easier to deal with: https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_NVPAPIOverview 不久前,我停止使用SOAP API,转而使用NVP API,在我看来,NVP API更加容易处理: https ://cms.paypal.com/uk/cgi-bin/?cmd=_render-content &content_ID =显影剂/ e_howto_api_nvp_NVPAPIOverview

I made available a library to do all the work for you: https://github.com/davidduffett/Moolah 我提供了一个库来为您完成所有工作: https : //github.com/davidduffett/Moolah

The instructions here show exactly how to use PayPal Express Checkout: https://github.com/davidduffett/Moolah#paypal-express-checkout 此处的说明确切显示了如何使用PayPal Express Checkout: https : //github.com/davidduffett/Moolah#paypal-express-checkout

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

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