diff --git a/ding_dibs/ding_dibs.module b/ding_dibs/ding_dibs.module index 9c7417c4c..66f5c174b 100644 --- a/ding_dibs/ding_dibs.module +++ b/ding_dibs/ding_dibs.module @@ -123,3 +123,14 @@ function ding_dibs_payment_prepare($amount, $params, $callback) { dibs_payment_prepare($params); } + +/** + * Implementation of hook_cron(). + * For security reasons we remove old transactions from the database + */ +function ding_dibs_cron() { + $res = db_query('DELETE FROM {dibs_transactions} WHERE DATEDIFF(sysdate(), payment_time) > 60 LIMIT 250'); + if(!$res){ + watchdog('ding_dibs', t('There was an error in deleting DIBS payment transactions')); + } +}