Skip to content

Commit

Permalink
Fixed non working sandbox mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Allimant committed Jul 12, 2023
1 parent 37518fd commit d3ce196
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
15 changes: 1 addition & 14 deletions Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<fullnamespace>PayPal\PayPal</fullnamespace>
<descriptive locale="en_US">
<title>PayPal</title>
<!--
<subtitle></subtitle>
<description></description>
<postscriptum></postscriptum>
-->
</descriptive>
<descriptive locale="fr_FR">
<title>PayPal</title>
Expand All @@ -20,22 +15,14 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>4.0.4</version>
<version>4.0.5</version>
<authors>
<author>
<name>gbarral</name>
<email>[email protected]</email>
</author>
</authors>
<type>classic</type>
<!--
module dependencies
<required>
<module version="&gt;=0.1">Front</module>
<module version="~1.0">HookCart</module>
<module version="&gt;0.2">HookSearch</module>
</required>
-->
<thelia>2.4.0</thelia>
<stability>other</stability>
</module>
16 changes: 6 additions & 10 deletions Service/Base/PayPalBaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public static function getApiContext()
*/
public static function getLogin()
{
if ((bool)PayPal::getConfigValue('sandbox') === 1) {
if ((bool)PayPal::getConfigValue('sandbox') === true) {
$login = PayPal::getConfigValue('sandbox_login');
} else {
$login = PayPal::getConfigValue('login');
Expand All @@ -370,7 +370,7 @@ public static function getLogin()
*/
public static function getPassword()
{
if ((bool)PayPal::getConfigValue('sandbox') === 1) {
if ((bool)PayPal::getConfigValue('sandbox') === true) {
$password = PayPal::getConfigValue('sandbox_password');
} else {
$password = PayPal::getConfigValue('password');
Expand All @@ -384,7 +384,7 @@ public static function getPassword()
*/
public static function getMerchantId()
{
if ((bool)PayPal::getConfigValue('sandbox') === 1) {
if ((bool)PayPal::getConfigValue('sandbox') === true) {
$login = PayPal::getConfigValue('sandbox_merchant_id');
} else {
$login = PayPal::getConfigValue('merchant_id');
Expand All @@ -398,7 +398,7 @@ public static function getMerchantId()
*/
public static function getMode()
{
if ((bool)PayPal::getConfigValue('sandbox') === 1) {
if ((bool)PayPal::getConfigValue('sandbox') === true) {
$mode = 'sandbox';
} else {
$mode = 'live';
Expand All @@ -407,12 +407,8 @@ public static function getMode()
return $mode;
}

public static function isSandboxMode()
public static function isSandboxMode(): bool
{
if (self::getMode() === 'live') {
return false;
}

return true;
return self::getMode() === 'sandbox';
}
}

0 comments on commit d3ce196

Please sign in to comment.