Common use cases
Directory structure
Manifest
Complete example: Slack notification plugin
This plugin sends a message to Slack whenever a payment is completed or fails.Plugin.php
SlackNotifier.php
Configuration UI
Thefields() method defines the settings form that appears in the admin panel. Values are stored per-brand and accessed via SettingsRepository.
Error handling best practices
- Always check if the webhook URL is configured before making outbound calls
- Set a short HTTP timeout (5 seconds) so your hook callback does not block checkout
- Never throw from a hook callback - the error isolation wrapper catches it, but logging is better
- Log failed outbound calls for debugging
Testing
- Install and activate the plugin
- Configure the Slack webhook URL in the plugin settings
- Create a test payment using a test card
- Verify the Slack message arrives