Skip to content

Commit 8841647

Browse files
authored
Merge pull request #8 from backbonesk/fix/sporopay-precision
SLSPSporoPay always requires amount in format of two decimal places
2 parents fdf495a + 67db17e commit 8841647

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Changelog
22

3+
### v0.20.1: 2020/08/13
4+
5+
Always format SLSPSporoPay amount to two decimal places.
6+
37
### v0.20.0: 2020/07/27
48

59
Added support for ePlatby VÚB sandbox.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Simple and unified object-oriented library written in PHP for e-commerce service
1919

2020
* [PayPal](http://www.paypal.com) -- PayPal (Europe) S.à r.l. et Cie, S.C.A.
2121

22-
The current version of the library is v0.20.0 and requires PHP 5.4 or PHP 7+ to work. Even though there are things to make better, it is already being used in production without any sort of problems.
22+
The current version of the library is v0.20.1 and requires PHP 5.4 or PHP 7+ to work. Even though there are things to make better, it is already being used in production without any sort of problems.
2323

2424
Chaching library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
2525

@@ -28,7 +28,7 @@ The recommended way to install the library is to use [composer](http://getcompos
2828

2929
{
3030
"require": {
31-
"backbone/chaching": "0.20.0"
31+
"backbone/chaching": "0.20.1"
3232
}
3333
}
3434

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "backbone/chaching",
33
"type": "library",
4-
"version": "0.20.0",
4+
"version": "0.20.1",
55
"license": "MIT",
66
"description": "Universal payment library for banking services in Slovakia",
77
"keywords": [

src/Chaching/Chaching.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class Chaching
1818
{
19-
const VERSION = '0.20.0';
19+
const VERSION = '0.20.1';
2020

2121
const CARDPAY = 'cardpay';
2222
const SPOROPAY = 'sporopay';

src/Chaching/Drivers/SLSPSporoPay/Request.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ protected function validate()
117117
// Validate all required fields first
118118
$this->validate_required_fields();
119119

120-
if (!is_string($this->fields['suma']))
121-
{
122-
$this->fields['suma'] = sprintf('%01.2F', $this->fields['suma']);
123-
}
120+
$this->fields['suma'] = sprintf('%01.2F', $this->fields['suma']);
124121

125122
if (!preg_match('/^[0-9]{1,13}(\.[0-9]{1,2})?$/', $this->fields['suma']))
126123
throw new InvalidOptionsException(sprintf(

0 commit comments

Comments
 (0)