Skip to content

Commit

Permalink
Merge pull request #135 from Invertus/SL-203-match-shop-language-with…
Browse files Browse the repository at this point in the history
…-iframe

SL-203: match shop language with iframe
  • Loading branch information
mant02 authored Dec 12, 2023
2 parents c210cc5 + 2ae7b3d commit 6f851d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Service/Request/InitializeRequestObjectCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Invertus\SaferPay\DTO\Request\RequestHeader;
use Invertus\SaferPay\DTO\Request\Initialize\InitializeRequest;
use Invertus\SaferPay\DTO\Request\Payer;
use PrestaShop\PrestaShop\Adapter\Shop\Context;

if (!defined('_PS_VERSION_')) {
exit;
Expand Down Expand Up @@ -68,6 +69,12 @@ public function create(
$totalPrice = (int) (round($totalPrice));
$payment = $this->requestObjectCreator->createPayment($cart, $totalPrice);
$payer = new Payer();

$languageCode = !empty($cart->getAssociatedLanguage()->iso_code)
? $cart->getAssociatedLanguage()->iso_code
: 'en';

$payer->setLanguageCode($languageCode);
$returnUrl = $this->requestObjectCreator->createReturnUrl($returnUrl);
$notification = ($isBusinessLicence && version_compare(Configuration::get(RequestHeader::SPEC_VERSION), '1.35', '<')) ? null : $this->requestObjectCreator->createNotification($customerEmail, $notifyUrl);
$deliveryAddressForm = $this->requestObjectCreator->createDeliveryAddressForm();
Expand Down

0 comments on commit 6f851d1

Please sign in to comment.