Skip to content

Commit

Permalink
Merge pull request #163 from mewebstudio/162-kuveytturk-html-parsing-…
Browse files Browse the repository at this point in the history
…is-failing-with-custom-html-tags

fix issue #162 KuveytPos HTML parse is failing when there is a custom HTML tag
  • Loading branch information
nuryagdym authored Oct 31, 2023
2 parents 5022b51 + 59bf29a commit f1a42a7
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 38 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ext-SimpleXML": "*",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-openssl": "*",
"php-http/discovery": "^1.14",
"psr/http-client-implementation": "*",
Expand Down
6 changes: 5 additions & 1 deletion src/Gateways/KuveytPos.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ private function getCommon3DFormData(KuveytPosAccount $account, $order, string $
private function transformReceived3DFormData(string $response): array
{
$dom = new DOMDocument();
$dom->loadHTML($response);
/**
* Kuveyt Pos started sending HTML with custom HTML tags such as <APM_DO_NOT_TOUCH>.
* Without LIBXML_NOERROR flag loadHTML throws "Tag apm_do_not_touch invalid in Entity" exception
*/
$dom->loadHTML($response, LIBXML_NOERROR);

$gatewayURL = '';
/** @var \DOMElement $formNode */
Expand Down
Loading

0 comments on commit f1a42a7

Please sign in to comment.