Skip to content
This repository has been archived by the owner on Nov 12, 2017. It is now read-only.

Commit

Permalink
Implemented hook_cron() and other necessary hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
sepehr committed Oct 22, 2010
1 parent 84ff938 commit 7475de1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uc_parsian.module
Expand Up @@ -144,7 +144,10 @@ function uc_parsian_form_alter(&$form, &$form_state, $form_id) {
* Deletes orphan authority codes generated by failed payments older than ten minutes.
*/
function uc_parsian_cron() {

if (variable_get('uc_parsian_cron_purge', TRUE)) {
db_query("DELETE FROM {uc_payment_parsian} WHERE status = 0 AND %d - created > %d", time(), 600);
watchdog('cron', 'Orphan authority records generated by failed Parsian payments has been successfully removed.');
}
}

/**
Expand All @@ -154,7 +157,9 @@ function uc_parsian_cron() {
* on the custom order completion page.
*/
function uc_parsian_ucga_display() {

if (arg(0) == 'cart' && arg(1) == 'parsian' && arg(2) == 'complete') {
return TRUE;
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions uc_parsian.pages.inc
Expand Up @@ -291,3 +291,4 @@ function _uc_parsian_error_translate($code) {
return $code . ' - ' . t('Unknown status code. Refer to your technical documentation or contact Parsian bank support.');
}
}

0 comments on commit 7475de1

Please sign in to comment.