Skip to content

Commit

Permalink
forcing utf8 encoding on xml of request
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanRijpkema committed Oct 19, 2021
1 parent 3d8f6ac commit c5580ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
```
Expand Down
10 changes: 7 additions & 3 deletions src/Bluem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -496,10 +500,10 @@ public function PerformRequest(BluemRequest $transaction_request)
echo PHP_EOL . "<BR>HEADER// " . 'x-ttrs-files-count: ' . '1';
echo PHP_EOL . "<BR>HEADER// " . 'x-ttrs-filename: ' . $xttrs_filename;
echo "<HR>";
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) {
Expand Down

0 comments on commit c5580ae

Please sign in to comment.