Mozzak
Mozzak

Reputation: 211

Issue with Paypal Payments Pro

I am implementing an online store for the last few months and have it successfully connected to the Sandbox of paypal for paypal payments pro gateway. It worked flawlessly since the beginning.

Since over the weekend it is not working anymore. The store gives me the following error:

    ERROR CALLING PAYMENT GATEWAY

    The trace gives me this error:

    Could not create SSL/TLS secure channel

    Page URL:/checkoutreview.aspx  Source:System.Web.Services  Message:The request was aborted: Could not create SSL/TLS secure channel.
  Stack Trace:
     at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
     at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
     at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
     at AspDotNetStorefrontGateways.Processors.PayPalAPIAASoapBinding.DoDirectPayment(DoDirectPaymentReq DoDirectPaymentReq) in C:\Development\Natrol\AspDotNetStorefront\ASPDNSFGateways\PayPalSvcAPIv30.cs:line 956
     at AspDotNetStorefrontGateways.Processors.PayPal.ProcessCard(Int32 OrderNumber, Int32 CustomerID, Decimal OrderTotal, Boolean useLiveTransactions, TransactionModeEnum TransactionMode, Address UseBillingAddress, String CardExtraCode, Address UseShippingAddress, String CAVV, String ECI, String XID, String& AVSResult, String& AuthorizationResult, String& AuthorizationCode, String& AuthorizationTransID, String& TransactionCommandOut, String& TransactionResponse) in C:\Development\Natrol\AspDotNetStorefront\ASPDNSFGatewayProcessors\GatewayPayPal\PayPal.cs:line 415
     at AspDotNetStorefrontGateways.GatewayTransaction.CallGateway(String gateway) in C:\Development\Natrol\AspDotNetStorefront\ASPDNSFGateways\GatewayTransaction.cs:line 205
     at AspDotNetStorefrontGateways.GatewayTransaction.Process() in C:\Development\Natrol\AspDotNetStorefront\ASPDNSFGateways\GatewayTransaction.cs:line 176 

What is going on here ? Any idea what happened and how to solve it ? Why would it break all of a sudden ?

thanks, Michael

Upvotes: 4

Views: 3539

Answers (3)

tkerwood
tkerwood

Reputation: 1905

If you are using paypal_base.dll, then the url you need to change is embedded inside it and PayPal have not release a new one (as yet). To override the setting you need to add the following to your web.config file. Add the following to the < configSections >.

<section name="paypal" type="com.paypal.sdk.core.ConfigSectionHandler, paypal_base"/>

Then add the following < paypal > section.

<paypal>
    <endpoints>
      <wsdl>
        <environment name="live">
          <port name="PayPalAPI">https://api.paypal.com/2.0/</port>
          <port name="PayPalAPIAA">https://api-aa.paypal.com/2.0/</port>
          <port name="PayPalAPI" threetoken="true">https://api-3t.paypal.com/2.0/</port>
          <port name="PayPalAPIAA" threetoken="true">https://api-aa-3t.paypal.com/2.0/</port>
        </environment>
        <environment name="sandbox">
          <port name="PayPalAPI">https://api.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPIAA">https://api-aa.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPI" threetoken="true">https://api-3t.sandbox.paypal.com/2.0/</port>
          <port name="PayPalAPIAA" threetoken="true">https://api-3t.sandbox.paypal.com/2.0/</port>
        </environment>
      </wsdl>
    </endpoints>
  </paypal>

(see https://www.x.com/developers/paypal/forums/paypal-sandbox/c-sdk-sandbox-three-token-endpoint)

Upvotes: 9

paul
paul

Reputation: 31

Following is true if you are using "signature" authentication:

Point is that few weeks ago endpoint https://api.sandbox.paypal.com/2.0/ stopped working. Now should use this one instead: https://api-3t.sandbox.paypal.com/2.0/

To do that I changed endpoints for sandbox in "paypal-endpoint.xml" found in PayPal's SDK. Download SDK, find "paypal-endpoint.xml", find Sandbox section and change addresses to be one mentined above. Then recompile the paypal_base.dll and use it

Here is posted very similar solution, but XMLs are published in web.config: www . x . com/developers/paypal/forums/paypal-sandbox/c-sdk-sandbox-three-token-endpoint

Google for "PayPal endpoints" to get more info about current PayPal's endpoints

Upvotes: 3

DropHit
DropHit

Reputation: 1724

I'm guessing you are using "Signature" as opposed to "Certificate: auth? And possibly running from a local IP when testing?

The paypal sandbox environment gets confused :) (Official response from paypal) and wants to see "Certificate" in some calls.

We have an instance where we are using the .NET paypal API SDK with APISignature auth - Meaning we have no way to change endpoint (.NET sdk version 51), and we have no cert installed (not needed with signature auth). The function of creating a profile works FINE on sandbox (CreateRecurringPaymentsProfile), BUT doing a transaction lookup (TransactionSearch) results in "Could not create SSL/TLS secure channel". When we move to the "live" environment, both work fine.

The only fix we have found is to change to "cert: auth, install the cert, and it seems to work fine. Which is a royal PITA.

Upvotes: 2

Related Questions