diff --git a/src/Direkt/DPayment.php b/src/Direkt/DPayment.php index c5d1d7b..ad146d2 100644 --- a/src/Direkt/DPayment.php +++ b/src/Direkt/DPayment.php @@ -647,7 +647,7 @@ public function getBody() 'user_name' => $this->getUserName(), 'user_address' => $this->getUserAddress(), 'user_phone' => $this->getUserPhone(), - 'user_basket' => $this->getBasket()->formatted(), + 'user_basket' => $this->getBasket()->toString(), 'debug_on' => $this->getDebugOn(), 'sync_mode' => $this->getSyncMode(), 'store_card' => $this->getStoreCard(), diff --git a/src/Payment/Basket.php b/src/Payment/Basket.php index 78d5865..501756e 100644 --- a/src/Payment/Basket.php +++ b/src/Payment/Basket.php @@ -46,4 +46,9 @@ public function formatted(): string { return base64_encode(json_encode($this->products)); } + + public function toString(): string + { + return htmlentities(json_encode($this->products)); + } } \ No newline at end of file