Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 614
Mozzak Avatar asked Dec 08 '22 21:12

Mozzak


2 Answers

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)

like image 153
tkerwood Avatar answered Mar 07 '23 13:03

tkerwood


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

like image 31
paul Avatar answered Mar 07 '23 11:03

paul