<?php /** * This file contains package_quiqqer_coupons_ajax_delete */ use QUI\ERP\Coupons\Handler; /** * Redeem a CouponCode * * @param int $id - CouponCode ID * @return bool - success */ QUI::$Ajax->registerFunction( 'package_quiqqer_coupons_ajax_frontend_redeem', function ($id) { $id = (int)$id; try { $CouponCode = Handler::getCouponCode($id); } catch (\Exception $Exception) { QUI\System\Log::writeException($Exception); QUI::getMessagesHandler()->addError( QUI::getLocale()->get( 'quiqqer/coupons', 'message.ajax.general_error' ) ); return false; } return true; }, ['id'], 'Permission::checkAdminUser' );