Swish ECommerce - Hooks (Actions)

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.

Read more about action and filter hooks here:
In Swish ECommerce there are some actions and filters available, mainly for modifying the order data sent to Swish and how to display extra data in Swish elements

Callback Action

Action:  'woocommerce_api_wc_gateway_swish_ecommerce'

Description: Fired when a callback related to Swish is recived

This action can be used to create custom logic based on callback data.

Valid Paymentrequest Callback Action

Action:  'valid-swish-ecommerce-paymentrequest-callback'

Parameters:
$posted String containing callback data from Swish
$order A WC_Order object related to the order.

Description: Fired when the callback was validated.

This action can be used to create custom logic when a callback is recived.

Valid Refund Callback Action

Action:  'valid-swish-ecommerce-refund-callback'

Parameters:
$posted String containing callback data from Swish
$order A WC_Order object related to the order.

Description: Fired when the callback was validated.

This action can be used to create custom logic when a callback is recived.

Before Form Fields Action

Action:  'redlight_swish_ecommerce_form_start'

Parameters:
$posted String payment gateway id redlight_swish-ecommerce

Description: Fired before the form fields are displayed in checkout

This action can be used to output information before the form fields

After Form Fields Action

Action:  'redlight_swish_ecommerce_form_end'

Parameters:
$posted String payment gateway id redlight_swish-ecommerce

Description: Fired after the form fields are displayed in checkout

This action can be used to output information after the form fields