Jump to content

Cannot activate PayPal options in PayPal module nor can I add credentials


ranidh

Recommended Posts

I've been looking for an answer for several days but nothing has come up. Which seems that I am the only one with this problem.

 

I work with PrestaShop 1.7 and via the modules I installed the PayPal 1.4 addon. When I click configure I can activate 2 PayPal products, when I like activate nothing happens. It just refreshes the page. When I go to the parameters information tab I can't fill in credentials either. I can however select/deselect payment by card, etc. When I change those options it says that the PayPal information has been updated.

 

However the PayPal option doesn't show on check-out, which is logic since I never put in ANY credentials. 

 

How can I fix this? It's quite an annoying problem and I just want my shop to go online. 

 

Thanks in advance!

Link to comment
Share on other sites

Enable debug mode and try to activate again and than check what error it gives.

Thanks

 

It gives me this error: Notice on line 482 in file /home/richgonebt/www/modules/paypal/paypal.php

[8] Trying to get property of non-object

Link to comment
Share on other sites

  • 2 weeks later...

Well, I do not have ssl installed on my dev server at all, so it's not on the PS server side - it's rather to do with CURL and SSL certificates. As wrote above - configuring certificates in php.ini solved it for me.

Link to comment
Share on other sites

  • 2 weeks later...

curl.cainfo didn't work.

 

Problem is :  481 du fichier C:\\wamp\\www\\sutekinamono\\modules\\paypal\\paypal.php

[8] Trying to get property of non-object

 

 at ligne 481: 

 if (!$result->error && isset($result->data->url)) {

After some test, !$result-> is non-object.

at end of paypal.php you can find the function that leads to this error

 

public function getPartnerInfo($method)
    {
        $return_url = $this->context->link->getAdminLink('AdminModules', true).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
        if (Configuration::get('PS_SSL_ENABLED')) {
            $shop_url = Tools::getShopDomainSsl(false);
        } else {
            $shop_url = Tools::getShopDomain(true);
        }


        $partner_info = array(
            'email'         => $this->context->employee->email,
            'shop_url'      => Tools::getShopDomainSsl(true),
            'address1'      => Configuration::get('PS_SHOP_ADDR1',null, null, null, ''),
            'address2'      => Configuration::get('PS_SHOP_ADDR2',null, null, null, ''),
            'city'          => Configuration::get('PS_SHOP_CITY',null, null, null, ''),
            'country_code'  => Tools::strtoupper($this->context->country->iso_code),
            'postal_code'   => Configuration::get('PS_SHOP_CODE',null, null, null, ''),
            'state'         => Configuration::get('PS_SHOP_STATE_ID',null, null, null, ''),
            'return_url'    => $return_url,
            'first_name'    => $this->context->employee->firstname,
            'last_name'     => $this->context->employee->lastname,
            'shop_name'     => Configuration::get('PS_SHOP_NAME',null, null, null, ''),
            'ref_merchant'  => 'prestashop_'._PS_VERSION_.'_'.$this->version,
        );
        $sdk = new PaypalSDK(Configuration::get('PAYPAL_SANDBOX'));
        $response = $sdk->getUrlOnboarding($partner_info);
        return $response;
    }

I cannot figure out what is wrong with this, but $result->data->url is blank and cannot process to the following code

$result = Tools::jsonDecode($response);
   if (!$result->error && isset($result->data->url)) {
      Tools::redirectLink( $result->data->url);
    }
Edited by Himaji (see edit history)
Link to comment
Share on other sites

Status: Solved.

 

PS 1.7.2.1

Paypal module: 4.1.0

 

I found the problem. As it is listed here: https://stackoverflow.com/questions/17478283/paypal-access-ssl-certificate-unable-to-get-local-issuer-certificate/19149687#19149687

 

Paypal developer website does never mention that an SSL certificate is required to use PayPal access API

 

It's easy to fix (php 5.3.7 or higher)Download a list file with an up-to-date certificate authorities, and add this setting to your php.ini

curl.cainfo=<path-to>cacert.pem

 

Restart your web server, and it'll work!

 

Regards,

 

MFM

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...
  • 3 years later...
On 8/23/2017 at 9:55 PM, mflorezm said:

Status: Solved.

 

PS 1.7.2.1

Paypal module: 4.1.0

 

I found the problem. As it is listed here: https://stackoverflow.com/questions/17478283/paypal-access-ssl-certificate-unable-to-get-local-issuer-certificate/19149687#19149687

 

Paypal developer website does never mention that an SSL certificate is required to use PayPal access API

 

It's easy to fix (php 5.3.7 or higher)Download a list file with an up-to-date certificate authorities, and add this setting to your php.ini

curl.cainfo=<path-to>cacert.pem

 

Restart your web server, and it'll work!

 

Regards,

 

MFM

Worked for me in Prestashop 1.7.7.0

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...