From 9d0f096e475b69789cd6f4370efa5d727fc48b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 7 Dec 2015 11:46:47 +0100 Subject: [PATCH 1/5] Update paypal.lib.php --- htdocs/paypal/lib/paypal.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 824f312a9af..045863c2c4f 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -702,8 +702,10 @@ function hash_call($methodName,$nvpStr) exit;*/ curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); - //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3 + //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // unsecure, no more accepted curl_setopt($ch, CURLOPT_SSLVERSION, 1); // Force TLSv1 + // After 14 january 2016 paypal will accept tls v1.2 and no more tls v1 + //curl_setopt($ch, CURLOPT_SSLVERSION, 6); // Force TLSv1.2 //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); From 9e0817ac05d3af92091c3c5405ea06c63a564902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Dec 2015 16:28:22 +0100 Subject: [PATCH 2/5] Update paypal.lib.php --- htdocs/paypal/lib/paypal.lib.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 045863c2c4f..f06624cb076 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -702,10 +702,8 @@ function hash_call($methodName,$nvpStr) exit;*/ curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); - //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // unsecure, no more accepted - curl_setopt($ch, CURLOPT_SSLVERSION, 1); // Force TLSv1 - // After 14 january 2016 paypal will accept tls v1.2 and no more tls v1 - //curl_setopt($ch, CURLOPT_SSLVERSION, 6); // Force TLSv1.2 + // TLSv1 by default or change to TLSv1.2 in module configuration + curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION)); //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); From 9bb9e6b787956756f8e2b7b5d2f49f9f52d08e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Dec 2015 16:29:35 +0100 Subject: [PATCH 3/5] Update paypal.php --- htdocs/paypal/admin/paypal.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index fd649b825bc..f02c720a388 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -119,6 +119,7 @@ print '
'; print ''; +// Account Parameters $var=true; print ''; print ''; @@ -151,6 +152,13 @@ print ''; +$var=!$var; +print ''; + +// Usage Parameters $var=true; print ''; print ''; From 5f0c7b6c3886bfeb940b309d20122df5b063b335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Dec 2015 16:31:11 +0100 Subject: [PATCH 4/5] Update paypal.lang --- htdocs/langs/en_US/paypal.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index b2eadfce654..54f8cb1980f 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -8,6 +8,7 @@ PAYPAL_API_SANDBOX=Mode test/sandbox PAYPAL_API_USER=API username PAYPAL_API_PASSWORD=API password PAYPAL_API_SIGNATURE=API signature +PAYPAL_SSLVERSION=Curl SSL Version PAYPAL_API_INTEGRAL_OR_PAYPALONLY=Offer payment "integral" (Credit card+Paypal) or "Paypal" only PaypalModeIntegral=Integral PaypalModeOnlyPaypal=PayPal only From ac04fdbd9a9d1e0018778a13a8213863f4a68210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 10 Dec 2015 16:49:55 +0100 Subject: [PATCH 5/5] Update paypal.php --- htdocs/paypal/admin/paypal.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index f02c720a388..89065cb7c77 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -51,6 +51,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_API_SIGNATURE",GETPOST('PAYPAL_API_SIGNATURE','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYPAL_SSLVERSION",GETPOST('PAYPAL_SSLVERSION','alpha'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_CREDITOR",GETPOST('PAYPAL_CREDITOR','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY','alpha'),'chaine',0,'',$conf->entity);
'.$langs->trans("AccountParameter").'
'; +print $langs->trans("PAYPAL_SSLVERSION").''; +print $form->selectarray("PAYPAL_SSLVERSION",array('1'=> $langs->trans('TLSv1'),'6'=> $langs->trans('TLSv1.2')),$conf->global->PAYPAL_SSLVERSION); +print '
'.$langs->trans("UsageParameter").'