From c5580aea35aa762bd14df53e6882f0f96fcfb32e Mon Sep 17 00:00:00 2001 From: Daan Rijpkema Date: Tue, 19 Oct 2021 10:19:43 +0200 Subject: [PATCH] forcing utf8 encoding on xml of request --- README.md | 4 ++-- src/Bluem.php | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 18b8bef..e8dd62e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Utilized by other applications as well: ## Notes per version PHP 7.0+ is required for all versions of this library. Please use the major git releases for the stable versions of this plugin. -### Notes version 2.1 (upcoming) +### Notes version 2.0.12 (latest) Allowing the verification if the current IP is based in the Netherlands utilizing a geolocation integration *(IPAPI). Use this feature through the Helper/IPAPI class. Currently implemented public function is: ```php $bluem->VerifyIPIsNetherlands(); @@ -36,7 +36,7 @@ Triodos Bank, BIC TRIONL2U no longer supported for Identity requests as of 1 jun ### Notes version 2.0.1: Major release with more stability, validation and features. -Please note: The main Integration class is called Bluem, so to include it, use something like: +Please note: The main Integration class is called Bluem, so to include it, use: ```php $bluem = new Bluem($config); ``` diff --git a/src/Bluem.php b/src/Bluem.php index bd714c5..bdce3fa 100644 --- a/src/Bluem.php +++ b/src/Bluem.php @@ -451,7 +451,11 @@ public function CreateEntranceCode(): String public function PerformRequest(BluemRequest $transaction_request) { $validator = new Validator(); - if (!$validator->validate($transaction_request->RequestContext(), $transaction_request->XmlString())) { + if (!$validator->validate( + $transaction_request->RequestContext(), + utf8_encode($transaction_request->XmlString()) + ) + ) { return new ErrorBluemResponse( "Error: Request is not formed correctly. More details: ". implode( @@ -496,10 +500,10 @@ public function PerformRequest(BluemRequest $transaction_request) echo PHP_EOL . "
HEADER// " . 'x-ttrs-files-count: ' . '1'; echo PHP_EOL . "
HEADER// " . 'x-ttrs-filename: ' . $xttrs_filename; echo "
"; - echo PHP_EOL . "BODY: " . $transaction_request->XmlString(); + echo PHP_EOL . "BODY: " . utf8_encode($transaction_request->XmlString()); } - $req->setBody($transaction_request->XmlString()); + $req->setBody(utf8_encode($transaction_request->XmlString())); try { $http_response = $req->send(); if ($verbose) {