function stripe_cron in Stripe 7
Implements hook_cron().
Stripe retains 30 days of event data, so delete event logs older than that, or less if configured to.
File
- ./
stripe.module, line 491 - stripe.module Drupal hooks used for integrating the Stripe service.
Code
function stripe_cron() {
$expiration_day = variable_get('stripe_log_webhooks_expire_days', 30) + 1;
// Delete old, processed webhooks.
db_query("DELETE FROM {stripe_webhook_events} WHERE processed >= :time", array(
':time' => strtotime($expiration_day . ' days'),
));
}