Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions lib/setup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ function paymill_install_webhooks(){
}catch(Exception $e){
echo __($e->getMessage(),'paymill');
}

// orphaned webhooks found, delete them
try{
if($webhooks != false){
foreach($webhooks as $hook){
$GLOBALS['paymill_loader']->request_webhook = new $GLOBALS['paymill_loader']->request_webhook; // re-init class
$GLOBALS['paymill_loader']->request_webhook->setId($hook['id']);
$response = $GLOBALS['paymill_loader']->request->delete($GLOBALS['paymill_loader']->request_webhook);
}
}
}catch(Exception $e){
echo __($e->getMessage(),'paymill');
}
}

// still here? create new webhook
Expand Down Expand Up @@ -82,7 +69,6 @@ function paymill_check_webhook(){

$webhook_found = false;
$nothing_found = true;
$additional_webhooks = array();
$output = false;

$output .= '<div><h3>'.__('Webhook Status Check','paymill').'</h3><h4>'.__('Please note that Webhooks are currently used in WooCommerce integration only.','paymill').'</h4>';
Expand All @@ -107,8 +93,6 @@ function paymill_check_webhook(){
$webhook_found .= '</div>';

$nothing_found = false;
}else{
$additional_webhooks[] = $webhook['id'];
}
}
}
Expand All @@ -119,12 +103,7 @@ function paymill_check_webhook(){
}elseif($webhook_found){
$output .= $webhook_found;
}

if(count($additional_webhooks) > 0){
$output .= '<h3>'.__('Orphaned Webhooks found:').'</h3><div>'.implode('<br />',$additional_webhooks).'</div>';
$output .= '<p>'.__('These orphaned Webhooks should be deleted. Normally this will be done automaticly when saving new API keys via General Settings, but you can delete them via Paymill Dashboard, too.').'</p>';
}


$output .= '</div>';

return $output;
Expand Down Expand Up @@ -203,4 +182,4 @@ function paymill_install(){
}elseif(get_option('paymill_db_version') != PAYMILL_VERSION){
paymill_install();
}
?>
?>