Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from heidelpay/Zertifizierungs-Branch
Browse files Browse the repository at this point in the history
[change](JTL-50) Clear session language at the start of response hand…
  • Loading branch information
xBlack-Shadow committed Mar 14, 2019
2 parents 88853a1 + 4159e5d commit 0bd1704
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Email templates editable in shop backend.
- css file can be used to adjust style of iFrame.
- Licence file is saved in file format md will be shown before installation.
- It will be checked beforehand whether customer is 18 years old allready.
- Secured Invoice/DirectDebit: It will be checked beforehand whether customer is 18 years old already.


##114
Expand Down
19 changes: 13 additions & 6 deletions version/115/paymentmethod/heidelpay_standard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ public function handleNotification($order, $paymentHash, $args)
$heidelpayResponse = new Heidelpay\PhpPaymentApi\Response($args);
$this->checkHash($args, $heidelpayResponse);

/** Ensure that the mail language is not overwritten by the session language */
$this->unsetSessionLanguage();

if ($heidelpayResponse->isSuccess()) {
/* save order and transaction result to your database */
if ($this->verifyNotification($order, $args)) {
Expand Down Expand Up @@ -710,12 +713,6 @@ public function setOrderStatusToPaid($order)
public function sendConfirmationMail($order)
{
try {
/** If value is set the function sendConfirmationMail will use the session language instead the order
* language. Therefore we unset the session language value.
*/
if (isset($_SESSION['currentLanguage'])) {
unset($_SESSION['currentLanguage']);
}
parent::sendConfirmationMail($order);
} catch (Exception $e) {
$e = 'Update order status failed on order: ' . $order . ' in file: ' .
Expand Down Expand Up @@ -926,5 +923,15 @@ public function setInfoContent($args)
return null;
}

/** If value is set the function sendConfirmationMail will use the session language instead the order
* language. Therefore we unset the session language value.
*/
protected function unsetSessionLanguage()
{
if (isset($_SESSION['currentLanguage'])) {
unset($_SESSION['currentLanguage']);
}
}


}

0 comments on commit 0bd1704

Please sign in to comment.