Swish ECommerce - Hooks (Filters)
Hooks in WordPress essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.
Settings Filter
Filter: 'redlight_swish_ecommerce_settings'
Parameters:
$settings
Array containing the plugin settings
Description: Fired when the plugin is loaded.
Form Fields Filter
Filter: 'redlight_swish_ecommerce_form_fields'
Parameters:
$default_fields
Array containing the fields to be displayed in the checkout page
Description: Fired on checkout page when the option to display a form is set.
Callback Arguments Filter
Filter: 'redlight_swish_ecommerce_callback_args'
Parameters:
$args
Array containing the key and values to be converted to url arguments
Description: Fired when creating the callback url that is later sent to Swish, used for Refunds and Paymentrequests
Paymentrequest Message Filter
Filter: 'redlight_swish_ecommerce_paymentrequest_message'
Parameters:
$message
String containing the default message
$order
A WC_Order
object representing the order that the payment is being made for.
Description: Fired when creating a payment request that is later sent to Swish
Paymentrequest Data Filter
Filter: 'redlight_swish_ecommerce_paymentrequest_data'
Parameters:
$data
Array containing the default data that is being sent to Swish
$order
A WC_Order
object representing the order that the payment is being made for.
Description: Fired when creating a payment request that is later sent to Swish
Cancel Payment Request Data Filter
Filter: 'redlight_swish_ecommerce_cancel_paymentrequest_data'
Parameters:
$data
Array containing the default data that is being sent to Swish when canceling a payment $order
A WC_Order
object representing the order that the payment is being made for.
Description: Fired when canceling a payment request that is later sent to Swish
Refund Message Filter
Filter: 'redlight_swish_ecommerce_refund_message'
Parameters:
$message
String containing the default message
$order
A WC_Order
object representing the order that the refund is being made for.
Description: Fired when creating a refund that is later sent to Swish
Refund Data Filter
Filter: 'redlight_swish_ecommerce_refund_data'
Parameters:
$data
Array containing the default data that is being sent to Swish
$order
A WC_Order
object representing the order that the payment is being made for.
Description: Fired when creating a payment request that is later sent to Swish