Hooks & Filters
Below is a detailed description of the hooks and filters available in the Payment Page plugin, tailored for advanced developers. Each hook and filter includes its name, purpose, and usage examples.
Action Hooks
payment_page_after_payment
Purpose: Triggered after a payment is successfully processed.
Usage: Allows developers to execute additional actions like logging the transaction, notifying users, or updating external systems.
Example:
payment_page_settings_saved
Purpose: Called after the plugin settings are saved.
Usage: Use this hook to perform actions like clearing caches, sending notifications, or validating settings.
Example:
payment_page_gateway_initialized
Purpose: Invoked when a payment gateway is initialized.
Usage: Perform setup actions, such as validating configurations or preparing necessary resources.
Example:
payment_page_before_payment
Purpose: Triggered before a payment is processed.
Usage: Useful for running validation checks or modifying the payment request before it's sent to the gateway.
Example:
payment_page_gateway_disabling
Purpose: Executed when a payment gateway is being disabled.
Usage: Perform cleanup actions or notify users about the change.
Example:
Filter Hooks
payment_page_gateway_options
Purpose: Allows modification of the list of available payment gateways.
Usage: Customize which gateways are available to the user, adding or removing options as necessary.
Example:
payment_page_settings
Purpose: Filters the settings before they are saved.
Usage: Validate or modify settings to ensure they meet specific criteria.
Example:
payment_page_transaction_response
Purpose: Filters the response from payment gateways before it is processed by the plugin.
Usage: Modify response data for logging, notifications, or error handling.
Example:
payment_page_form_fields
Purpose: Allows modification of form fields rendered on the payment page.
Usage: Customize the payment form by adding or removing fields based on user needs.
Example:
payment_page_payment_methods
Purpose: Filters the list of payment methods available to users during checkout.
Usage: Add, remove, or modify payment methods based on specific criteria or conditions.
Example:
This section provides advanced developers with a detailed understanding of the available hooks and filters in the Payment Page plugin, including practical examples of how they can be implemented. If you need further elaboration on any specific hook or filter, or if you have additional questions, feel free to contact support.
Last updated