grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026hasSecretKey() && $gateway['active'] == '1') { try { $webhook = $idealGateway->getCurrentWebhookObject(); } catch (Exception $e) { echo '
'; // useful when user add wrong keys // e.q. This API call cannot be made with a publishable API key. Please use a secret API key. You can find a list of your API keys at https://dashboard.stripe.com/account/apikeys. echo $e->getMessage(); echo '
'; return; } $environment = $idealGateway->environment(); $endpoint = $idealGateway->getWebhookEndPoint(); $CI = &get_instance(); if ($CI->session->has_userdata('stripe-webhook-failure')) { echo '
'; echo '

Error: ' . $CI->session->userdata('stripe-webhook-failure') . '

'; echo 'The system was unable to create the required webhook endpoint for Stripe.'; echo '
You should consider creating webhook manually directly via Stripe dashboard for your environment (' . $environment . ')'; echo '

Webhook URL:
' . $endpoint; echo '

Webhook events:
' . implode(',
', idealModuleWebhookEvents()); echo '
'; } if (! $webhook || ! startsWith($webhook->url, site_url())) { echo '
'; echo 'Webhook endpoint (' . $endpoint . ') not found for ' . $environment . ' environment.'; echo '
Click here to create the webhook directly in Stripe.'; echo '
'; } elseif ($webhook->id != get_option('ideal_module_stripe_webhook_id')) { echo '
'; echo 'The application stored Stripe webhook id does not match the configured webhook.'; echo '
Click here to re-create the webhook directly in Stripe and delete the old webhook.'; echo '
'; } elseif ($webhook->status != 'enabled') { echo '
'; echo 'Your Stripe configured webhook is disabled, you should consider enabling your webhook via Stripe dashboard or by clicking here.'; echo '
'; } } } } hooks()->add_action('before_update_system_options', 'prevent_activate_ideal_gateway'); function prevent_activate_ideal_gateway($systemOptions): void { /** @var CI&object{'ideal_gateway': Ideal_gateway} $ci */ $ci = &get_instance(); $ci->load->library('ideal_gateway'); $options = $systemOptions['settings']; if (!is_array($options)) { // prevent bugs from module breaking the feature, e.g. third-party module developer did not wrap add value to settings[] return; } if (! array_key_exists('paymentmethod_Ideal_gateway_active', $options)) { return; } $idealKeyEmpty = empty($options['paymentmethod_Ideal_gateway_api_publishable_key']) || empty($options['paymentmethod_Ideal_gateway_api_secret_key']); $idealGatewayActive = $options['paymentmethod_Ideal_gateway_active'] == '1'; if ($idealKeyEmpty && $idealGatewayActive) { $ci->ideal_gateway->markAsInactive(); set_alert('danger', _l('ideal_gateway_cannot_be_activated_keys_not_configured')); redirect(admin_url('settings?group=payment_gateways&tab=online_payments_Ideal_gateway_tab')); } }