diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fda750..a56b4fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +### [1.8.3](https://github.com/ratepay/php-library/compare/1.8.2...1.8.3) (2023-01-16) + +### Update +* Change Ratepay address + ### [1.8.2](https://github.com/ratepay/php-library/compare/1.8.1...1.8.2) (2022-09-05) diff --git a/README.md b/README.md index 0d50c0b..4f66255 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ RatePAY Integration Toolkit for PHP | Repository | Common RatePAY PHP Library |------------|---------- | Author | Eduardo Iriarte-Mendez -| Version | `1.8.2` [Changelog](./CHANGELOG.md) +| Version | `1.8.3` [Changelog](./CHANGELOG.md) | Link | http://www.ratepay.com | Mail | integration@ratepay.com diff --git a/composer.json b/composer.json index 11417b5..e71dfdd 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "ratepay/php-library", "description": "Ratepay Payment-API PHP Library", - "version": "1.8.2", + "version": "1.8.3", "license": "MIT", "type": "library", "homepage": "https://ratepay.gitbook.io/docs/", @@ -28,7 +28,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.17@dev", - "donatj/mock-webserver": "dev-master", + "donatj/mock-webserver": "~2.5.0", "phpunit/phpunit": "^6.5||^7.5||^8.5||^9.0" }, "minimum-stability": "dev", diff --git a/src/Model/Request/SubModel/Constants.php b/src/Model/Request/SubModel/Constants.php index 8d89757..850975f 100644 --- a/src/Model/Request/SubModel/Constants.php +++ b/src/Model/Request/SubModel/Constants.php @@ -19,7 +19,7 @@ class Constants /** * Library version. */ - const LIBRARY_VERSION = '1.8.2'; + const LIBRARY_VERSION = '1.8.3'; /** * Supported RatePAY API version. diff --git a/src/Service/Math.php b/src/Service/Math.php index 3af02c0..1930b57 100644 --- a/src/Service/Math.php +++ b/src/Service/Math.php @@ -28,10 +28,12 @@ public static function isZero($number, $precission = 2) */ public static function netToGross($netPrice, $taxPercentage, $round = false) { - $withTax = $netPrice + $netPrice * $taxPercentage / 100; + $withTax = $netPrice * (1 + $taxPercentage / 100); if (!$round) { - return $withTax; + $localInfo = localeconv(); + + return floatval(number_format($withTax, 5, $localInfo['decimal_point'], $localInfo['thousands_sep'])); } $rounded = round($withTax, 2); diff --git a/src/locales/de.php b/src/locales/de.php index 31a5aa9..2deddef 100644 --- a/src/locales/de.php +++ b/src/locales/de.php @@ -55,8 +55,8 @@ 'rp_reason_code_translation_699' => 'Die Rate ist zu hoch für die minimal verfügbare Laufzeit. Die Rate wurde verringert.', 'rp_switch_payment_type_bank_transfer' => 'Ich möchte die Ratenzahlungen selbst vornehmen und nicht per Lastschrift begleichen.', 'rp_switch_payment_type_direct_debit' => 'Ich möchte die Ratenzahlungen bequem per Lastschrift begleichen.', - 'rp_address' => 'Ratepay GmbH, Franklinstraße 28-29, 10587 Berlin', - 'wcd_address' => 'Ratepay GmbH, Franklinstraße 28-29, 10587 Berlin', + 'rp_address' => 'Ratepay GmbH, Ritterstraße 12-14, 10969 Berlin', + 'wcd_address' => 'Ratepay GmbH, Ritterstraße 12-14, 10969 Berlin', 'rp_creditor' => 'Gläubiger-ID', 'rp_creditor_id' => 'DE39RPY00000568463', 'wcd_creditor_id' => 'DE39RPY00000568463', diff --git a/src/locales/en.php b/src/locales/en.php index 3b50d57..9f8e798 100644 --- a/src/locales/en.php +++ b/src/locales/en.php @@ -56,8 +56,8 @@ 'rp_reason_code_translation_699' => 'The instalment is too high for the minimum available runtime. The instalment has been reduced.', 'rp_switch_payment_type_bank_transfer' => 'I would like to make the instalments myself and not pay by direct debit', 'rp_switch_payment_type_direct_debit' => 'I would like to pay the instalments conveniently by direct debit', - 'rp_address' => 'RatePAY GmbH, Franklinstraße 28-29, 10587 Berlin', - 'wcd_address' => 'RatePAY GmbH, Franklinstraße 28-29, 10587 Berlin', + 'rp_address' => 'RatePAY GmbH, Ritterstraße 12-14, 10969 Berlin', + 'wcd_address' => 'RatePAY GmbH, Ritterstraße 12-14, 10969 Berlin', 'rp_creditor' => 'Creditor ID', 'rp_creditor_id' => 'DE39RPY00000568463', 'wcd_creditor_id' => 'DE39RPY00000568463', diff --git a/tests/Unit/Service/MathTest.php b/tests/Unit/Service/MathTest.php index d937cf4..a0c4090 100644 --- a/tests/Unit/Service/MathTest.php +++ b/tests/Unit/Service/MathTest.php @@ -27,6 +27,8 @@ public function provideNatPricesWithTaxRates() [100, 19, 119], [100, 0, 100], [29.99, 2.5, 30.73975], + [1029.99, 2.5, 1055.73975], + [12345.99, 8.9, 13444.78311], ]; } @@ -44,6 +46,8 @@ public function provideRoundedNatPricesWithTaxRates() [100, 19, 119.00], [100, 0, 100.00], [29.99, 2.5, 30.74], + [1029.99, 2.5, 1055.74], + [12345.99, 8.9, 13444.78], ]; }