Search code examples
paypalprestashoppaypal-sandboxbraintreeprestashop-1.7

Prestashop PayPal Error


I'm trying to add PayPal payments in a Prestashop (v1.7.3) store using the PayPal & Braintree Official Module (v3.11.6), but until now without success.

Installed and configured the module without any problems, but every time i proceed with a payment this error is displayed to the user:

enter image description here

Tested the module in both sandbox and production environments, and the error still persists.

What can be the problem?

UPDATE: After some debugging i found the origin of the problem. The problem is that the module is unable to connect to PayPal's API via cURL with SSL/TLS. I'm using Prestashop in Windows Server with IIS, and in this environment cURL has to be informed where the certificate authority is located in order to establish a secure connection. I downloaded the cacert.pem file from curl website, stored it in my server and then, in module files (PPHtmlConfig.php) i added the CA location in the cURL options settings manually:

CURLOPT_CAINFO => 'C:\\(...)\\cacert.pem',

Now i'm able to connect to PayPal's API and successfully make a payment!

I've contacted the module's tech support team and they are analysing this issue.


Solution

  • After several contacts with the module tech support, this is their final response to the issue:

    We do not know the specialty of your server. This is not a recurring error in our module. It happens if the CURL can not find the CA certificate. In general, we advise you to ask your server to verify that the CA certificate is correctly configured. Otherwise, it is necessary to specify the route or curl to find the certificate, for example, as you did in your module.

    At the moment there is no way to specify this in our module in general. So, you should wait for the next update of our Paypal module.

    So, if someone comes across the same issue when using a Windows Server environment, specify the complete CA path in the module files (as explained in the question update):

    I downloaded the cacert.pem file from curl website, stored it in my server and then, in module files (PPHtmlConfig.php) i added the CA location in the cURL options settings manually:

    CURLOPT_CAINFO => 'C:\\(...)\\cacert.pem',