diff --git a/ajax/frontend/redeem.php b/ajax/frontend/redeem.php index 7b5226addb17693962aba46689996a0f6146c359..f11c4182eb2b2ed2308384b72aa20370dbd32847 100644 --- a/ajax/frontend/redeem.php +++ b/ajax/frontend/redeem.php @@ -16,7 +16,8 @@ 'package_quiqqer_coupons_ajax_frontend_redeem', function ($code, $orderHash) { try { - Handler::getCouponCodeByCode($code); + $CouponCode = Handler::getCouponCodeByCode($code); + $CouponCode->checkRedemption(QUI::getUserBySession()); } catch (QUI\ERP\Coupons\CouponCodeException $Exception) { QUI\System\Log::writeDebugException($Exception); diff --git a/src/QUI/ERP/Coupons/CouponCode.php b/src/QUI/ERP/Coupons/CouponCode.php index 5ee626f5e370057f46d290bbb13edde3c6254b92..8852f1f7b67f8602f5720a8f61845cd167abde14 100644 --- a/src/QUI/ERP/Coupons/CouponCode.php +++ b/src/QUI/ERP/Coupons/CouponCode.php @@ -279,7 +279,7 @@ public function redeem($User = null) * @return void * @throws CouponCodeException - Thrown if not redeemable by the given User */ - protected function checkRedemption($User) + public function checkRedemption($User) { if (!$this->isValid()) { throw new CouponCodeException([