Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #162 KuveytPos HTML parse is failing when there is a custom HTML tag #163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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