Skip to content
Code-Schnipsel Gruppen Projekte
Commit 26fcf224 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

refactor: checkRedemption in ajax_redeem

Übergeordneter 67243b18
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
'package_quiqqer_coupons_ajax_frontend_redeem', 'package_quiqqer_coupons_ajax_frontend_redeem',
function ($code, $orderHash) { function ($code, $orderHash) {
try { try {
Handler::getCouponCodeByCode($code); $CouponCode = Handler::getCouponCodeByCode($code);
$CouponCode->checkRedemption(QUI::getUserBySession());
} catch (QUI\ERP\Coupons\CouponCodeException $Exception) { } catch (QUI\ERP\Coupons\CouponCodeException $Exception) {
QUI\System\Log::writeDebugException($Exception); QUI\System\Log::writeDebugException($Exception);
......
...@@ -279,7 +279,7 @@ public function redeem($User = null) ...@@ -279,7 +279,7 @@ public function redeem($User = null)
* @return void * @return void
* @throws CouponCodeException - Thrown if not redeemable by the given User * @throws CouponCodeException - Thrown if not redeemable by the given User
*/ */
protected function checkRedemption($User) public function checkRedemption($User)
{ {
if (!$this->isValid()) { if (!$this->isValid()) {
throw new CouponCodeException([ throw new CouponCodeException([
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren