From fab3fe3a35eea12297765bb904efdfdf797d0bc8 Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Tue, 19 Nov 2024 16:55:10 +0100 Subject: [PATCH 1/4] Allowing chamberofcommerce property to be nullable (#201) Co-authored-by: Shu Chen --- src/Models/Company.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Company.php b/src/Models/Company.php index 9d803e32..b2118e12 100644 --- a/src/Models/Company.php +++ b/src/Models/Company.php @@ -25,5 +25,5 @@ class Company extends Person protected string $companyName; protected bool $vatApplicable; protected string $vatNumber; - protected string $chamberOfCommerce; + protected ?string $chamberOfCommerce; } From 1ae9e5952ddc27f515e346dc2590c15bbb98da5d Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Thu, 21 Nov 2024 12:50:23 +0100 Subject: [PATCH 2/4] fix UTF-8 encoding issue in base64Data function --- src/Handlers/HMAC/Hmac.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Handlers/HMAC/Hmac.php b/src/Handlers/HMAC/Hmac.php index 0ef34533..0bcd5dbf 100644 --- a/src/Handlers/HMAC/Hmac.php +++ b/src/Handlers/HMAC/Hmac.php @@ -28,8 +28,7 @@ abstract class Hmac */ public function uri($uri = null) { - if ($uri) - { + if ($uri) { $uri = preg_replace("#^[^:/.]*[:/]+#i", "", $uri); $this->uri = strtolower(urlencode($uri)); @@ -46,11 +45,13 @@ public function base64Data($data = null) { $this->base64Data = ''; - if ($data) - { - if (is_array($data)) - { - $data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION); + if ($data) { + if (is_array($data)) { + $data = mb_convert_encoding( + json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), + 'UTF-8', + 'auto' + ); } $md5 = md5($data, true); @@ -67,8 +68,7 @@ public function base64Data($data = null) */ public function nonce($nonce = null) { - if ($nonce) - { + if ($nonce) { $this->nonce = $nonce; } @@ -81,8 +81,7 @@ public function nonce($nonce = null) */ public function time($time = null) { - if ($time) - { + if ($time) { $this->time = $time; } From eb56e98e1697808ef0ef65d2b6682caffcbf5102 Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Thu, 21 Nov 2024 12:51:15 +0100 Subject: [PATCH 3/4] rollback formatting --- src/Handlers/HMAC/Hmac.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Handlers/HMAC/Hmac.php b/src/Handlers/HMAC/Hmac.php index 0bcd5dbf..5b3befb6 100644 --- a/src/Handlers/HMAC/Hmac.php +++ b/src/Handlers/HMAC/Hmac.php @@ -28,7 +28,8 @@ abstract class Hmac */ public function uri($uri = null) { - if ($uri) { + if ($uri) + { $uri = preg_replace("#^[^:/.]*[:/]+#i", "", $uri); $this->uri = strtolower(urlencode($uri)); @@ -45,8 +46,10 @@ public function base64Data($data = null) { $this->base64Data = ''; - if ($data) { - if (is_array($data)) { + if ($data) + { + if (is_array($data)) + { $data = mb_convert_encoding( json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'UTF-8', @@ -68,7 +71,8 @@ public function base64Data($data = null) */ public function nonce($nonce = null) { - if ($nonce) { + if ($nonce) + { $this->nonce = $nonce; } @@ -81,7 +85,8 @@ public function nonce($nonce = null) */ public function time($time = null) { - if ($time) { + if ($time) + { $this->time = $time; } From 1dbdfb13e46ee49f68c28403ea39c235ffc5c20e Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Thu, 21 Nov 2024 14:53:42 +0100 Subject: [PATCH 4/4] update version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f11b5239..7cd2cc9c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/sdk", "description": "Buckaroo payment SDK", "license": "MIT", - "version": "1.16.0", + "version": "1.17.0", "type": "library", "require": { "php": "^8.1",