Skip to content

Commit

Permalink
Merge pull request #8 from backbonesk/fix/sporopay-precision
Browse files Browse the repository at this point in the history
SLSPSporoPay always requires amount in format of two decimal places
  • Loading branch information
Sibyx authored Aug 14, 2020
2 parents fdf495a + 67db17e commit 8841647
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### v0.20.1: 2020/08/13

Always format SLSPSporoPay amount to two decimal places.

### v0.20.0: 2020/07/27

Added support for ePlatby VÚB sandbox.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Simple and unified object-oriented library written in PHP for e-commerce service

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

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.
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.

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

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

{
"require": {
"backbone/chaching": "0.20.0"
"backbone/chaching": "0.20.1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backbone/chaching",
"type": "library",
"version": "0.20.0",
"version": "0.20.1",
"license": "MIT",
"description": "Universal payment library for banking services in Slovakia",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/Chaching/Chaching.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Chaching
{
const VERSION = '0.20.0';
const VERSION = '0.20.1';

const CARDPAY = 'cardpay';
const SPOROPAY = 'sporopay';
Expand Down
5 changes: 1 addition & 4 deletions src/Chaching/Drivers/SLSPSporoPay/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ protected function validate()
// Validate all required fields first
$this->validate_required_fields();

if (!is_string($this->fields['suma']))
{
$this->fields['suma'] = sprintf('%01.2F', $this->fields['suma']);
}
$this->fields['suma'] = sprintf('%01.2F', $this->fields['suma']);

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

0 comments on commit 8841647

Please sign in to comment.