Skip to content

Commit

Permalink
Merge pull request #12 from NicolasBarbey/fix/special_char
Browse files Browse the repository at this point in the history
fix billing with special characters
  • Loading branch information
NicolasBarbey authored Jun 26, 2024
2 parents 4be4b4d + 4060266 commit 5a2db1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<descriptive locale="fr_FR">
<title>Paiement en carte bancaire avec Paybox</title>
</descriptive>
<version>2.2.2</version>
<version>2.2.3</version>
<author>
<name>Franck Allimant</name>
<email>[email protected]</email>
Expand Down
8 changes: 4 additions & 4 deletions Paybox.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ protected function getBilling(Order $order): array|bool|string
$billingXml = new \SimpleXMLElement('<Billing/>');
$addressXml = $billingXml->addChild('Address');

$addressXml?->addChild('FirstName', $address->getFirstname());
$addressXml?->addChild('LastName', $address->getLastname());
$addressXml?->addChild('Address1', $address->getAddress1());
$addressXml?->addChild('FirstName', htmlentities($address->getFirstname()));
$addressXml?->addChild('LastName', htmlentities($address->getLastname()));
$addressXml?->addChild('Address1', htmlentities($address->getAddress1()));
$addressXml?->addChild('ZipCode', $address->getZipcode());
$addressXml?->addChild('City', $address->getCity());
$addressXml?->addChild('City', htmlentities($address->getCity()));
$addressXml?->addChild('CountryCode', $address->getCountry()->getIsocode());

return str_replace(["\n", "\r"], '', $billingXml->asXML());
Expand Down

0 comments on commit 5a2db1d

Please sign in to comment.