-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from mollie/5.0.4
5.0.4
- Loading branch information
Showing
108 changed files
with
296 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,39 +27,14 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Helper_Data extends Mage_Core_Helper_Abstract | ||
{ | ||
|
||
const MIN_API_VERSION = '2.1.0'; | ||
const CURRENCIES_WITHOUT_DECIMAL = array('JPY'); | ||
const SUPPORTED_LOCAL = array( | ||
'en_US', | ||
'nl_NL', | ||
'nl_BE', | ||
'fr_FR', | ||
'fr_BE', | ||
'de_DE', | ||
'de_AT', | ||
'de_CH', | ||
'es_ES', | ||
'ca_ES', | ||
'pt_PT', | ||
'it_IT', | ||
'nb_NO', | ||
'sv_SE', | ||
'fi_FI', | ||
'da_DK', | ||
'is_IS', | ||
'hu_HU', | ||
'pl_PL', | ||
'lv_LV', | ||
'lt_LT' | ||
); | ||
|
||
const XPATH_MODULE_ACTIVE = 'payment/mollie/active'; | ||
const XPATH_API_MODUS = 'payment/mollie/type'; | ||
const XPATH_LIVE_APIKEY = 'payment/mollie/apikey_live'; | ||
|
@@ -458,11 +433,7 @@ public function getAmountArray($currency, $value) | |
*/ | ||
public function formatCurrencyValue($value, $currency) | ||
{ | ||
$decimalPrecision = 2; | ||
if (in_array($currency, self::CURRENCIES_WITHOUT_DECIMAL)) { | ||
$decimalPrecision = 0; | ||
} | ||
|
||
$decimalPrecision = ($currency == 'JPY') ? 0 : 2; | ||
return number_format($value, $decimalPrecision, '.', ''); | ||
} | ||
|
||
|
@@ -480,7 +451,8 @@ public function getLocaleCode($storeId = null, $method = 'payment') | |
|
||
if ($locale == 'store' || (!$locale && $method == 'order')) { | ||
$localeCode = Mage::app()->getLocale()->getLocaleCode(); | ||
if (in_array($localeCode, self::SUPPORTED_LOCAL)) { | ||
$supportedLocale = $this->getSupportedLocale(); | ||
if (in_array($localeCode, $supportedLocale)){ | ||
$locale = $localeCode; | ||
} | ||
} | ||
|
@@ -874,4 +846,34 @@ public function getMethodByCode($code) | |
return $this->mollieMethods[$key]; | ||
} | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getSupportedLocale() | ||
{ | ||
return array( | ||
'en_US', | ||
'nl_NL', | ||
'nl_BE', | ||
'fr_FR', | ||
'fr_BE', | ||
'de_DE', | ||
'de_AT', | ||
'de_CH', | ||
'es_ES', | ||
'ca_ES', | ||
'pt_PT', | ||
'it_IT', | ||
'nb_NO', | ||
'sv_SE', | ||
'fi_FI', | ||
'da_DK', | ||
'is_IS', | ||
'hu_HU', | ||
'pl_PL', | ||
'lv_LV', | ||
'lt_LT' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* Copyright (c) 2012-2019, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -27,7 +27,7 @@ | |
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. ([email protected]) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @copyright Copyright (c) 2012-2019 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
|
Oops, something went wrong.