The WPSmartPay Integrations System provides a comprehensive framework for managing third-party integrations and extensions. This system allows developers to create, register, and manage integrations that extend WPSmartPay's functionality with external services and platforms.
Action Hooks
smartpay_integration_{namespace}_loaded
Type: Action (dynamic)
Fires: After an active integration namespace is booted.
Parameters: none
add_action('smartpay_integration_mailchimp_loaded', function() {
// Initialize mapping, etc.
});
smartpay_integrations_loaded
Type: Action
Fires: After all integrations have been processed.
Parameters: none
add_action('smartpay_integrations_loaded', function() {
// Post-load tasks.
});
Filter Hooks
smartpay_integrations
Purpose: Register Custom Integration
add_filter('smartpay_integrations', function($integrations) {
$integrations['my_integration'] = array(
'name' => 'My Integration',
'manager' => 'My\Integration\Manager',
'type' => 'free', // 'pro'
'categories' => array('CRM'),
'description' => 'Custom integration'
);
return $integrations;
});
smartpay_integration_manager
Purpose: Custom Manager
add_filter('smartpay_integration_manager', function($manager, $integration) {
if ($integration['name'] === 'My Integration') {
return 'My\Custom\Manager';
}
return $manager;
}, 10, 2);
smartpay_integration_get_not_installed_message
Purpose: Not Installed Message
add_filter('smartpay_integration_get_not_installed_message', function($message, $integration) {
if ($integration['name'] === 'My Integration') {
return 'My Integration is not installed. Please install it first.';
}
return $message;
}, 10, 2);
Common Use Cases
CRM integration
Email marketing
Analytics tracking
External APIs
Custom services