Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
b85dd664
Commit
b85dd664
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #4175 from frederic34/patch-3
Update paypal.lib.php
parents
9c206946
ac04fdbd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/langs/en_US/paypal.lang
+1
-0
1 addition, 0 deletions
htdocs/langs/en_US/paypal.lang
htdocs/paypal/admin/paypal.php
+10
-0
10 additions, 0 deletions
htdocs/paypal/admin/paypal.php
htdocs/paypal/lib/paypal.lib.php
+2
-2
2 additions, 2 deletions
htdocs/paypal/lib/paypal.lib.php
with
13 additions
and
2 deletions
htdocs/langs/en_US/paypal.lang
+
1
−
0
View file @
b85dd664
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
htdocs/paypal/admin/paypal.php
+
10
−
0
View file @
b85dd664
...
...
@@ -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
);
...
...
@@ -119,6 +121,7 @@ print '<br>';
print
'<table class="noborder" width="100%">'
;
// Account Parameters
$var
=
true
;
print
'<tr class="liste_titre">'
;
print
'<td>'
.
$langs
->
trans
(
"AccountParameter"
)
.
'</td>'
;
...
...
@@ -151,6 +154,13 @@ print '<input size="64" type="text" name="PAYPAL_API_SIGNATURE" value="'.$conf->
print
'<br>'
.
$langs
->
trans
(
"Example"
)
.
': ASsqXEmw4KzmX-CPChWSVDNCNfd.A3YNR7uz-VncXXAERFDFDFDF'
;
print
'</td></tr>'
;
$var
=!
$var
;
print
'<tr '
.
$bc
[
$var
]
.
'><td class="fieldrequired">'
;
print
$langs
->
trans
(
"PAYPAL_SSLVERSION"
)
.
'</td><td>'
;
print
$form
->
selectarray
(
"PAYPAL_SSLVERSION"
,
array
(
'1'
=>
$langs
->
trans
(
'TLSv1'
),
'6'
=>
$langs
->
trans
(
'TLSv1.2'
)),
$conf
->
global
->
PAYPAL_SSLVERSION
);
print
'</td></tr>'
;
// Usage Parameters
$var
=
true
;
print
'<tr class="liste_titre">'
;
print
'<td>'
.
$langs
->
trans
(
"UsageParameter"
)
.
'</td>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/paypal/lib/paypal.lib.php
+
2
−
2
View file @
b85dd664
...
...
@@ -702,8 +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); // Force SSLv3
curl_setopt
(
$ch
,
CURLOPT_SSLVERSION
,
1
);
// Force TLSv1
// 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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment