Fires after the main Redsys (redirect / credit card) gateway has confirmed a successful payment and the order has been marked as paid. Use it to trigger fulfilment, sync external systems, or send custom notifications once payment is final. It is fired from many code paths (standard payment, tokenized payment, pre-authorization capture, subscriptions, etc.).
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id ($order->get_id()).
Source: classes/class-wc-gateway-redsys.php:3699 (and many other locations in the same file).
PHP
add_action( 'redsys_post_payment_complete', 'my_redsys_payment_complete', 10, 1 );
function my_redsys_payment_complete( $order_id ) {
$order = wc_get_order( $order_id );
// Trigger your own fulfilment / CRM sync here.
error_log( 'Redsys payment complete for order ' . $order_id );
}
redsys_post_payment_errorAction
Fires whenever the Redsys gateway aborts or rejects a payment (signature mismatch, declined transaction, blocked card, missing authorization, etc.). The second argument carries the error message or reason. Use it for alerting, logging to an external monitor, or custom recovery flows.
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id.
$error
string
A human-readable error message or reason describing the failure.
Source: classes/class-wc-gateway-redsys.php:3357 (and many other locations across the gateway classes).
PHP
add_action( 'redsys_post_payment_error', 'my_redsys_payment_error', 10, 2 );
function my_redsys_payment_error( $order_id, $error ) {
error_log( sprintf( 'Redsys error on order %d: %s', $order_id, $error ) );
}
redsys_post_authorizationAction
Fires after a pre-authorization (authorization-only hold) is confirmed for an order, before the funds are captured. Use it to react to held authorizations, for example to log the reserved amount or notify staff that a capture is pending.
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id.
$amount
mixed
The authorized amount.
Source: classes/class-wc-gateway-redsys.php:9076.
PHP
add_action( 'redsys_post_authorization', 'my_redsys_authorization', 10, 2 );
function my_redsys_authorization( $order_id, $amount ) {
error_log( sprintf( 'Authorization held for order %d, amount %s', $order_id, $amount ) );
}
redsys_post_refundAction
Fires after a refund has been processed successfully through Redsys for an order. Use it to keep external accounting or ERP systems in sync with refunds issued from WooCommerce.
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id.
$amount
mixed
The refunded amount.
$reason
string
The refund reason as entered in WooCommerce.
Source: classes/class-wc-gateway-redsys.php:9786.
PHP
add_action( 'redsys_post_refund', 'my_redsys_refund', 10, 3 );
function my_redsys_refund( $order_id, $amount, $reason ) {
error_log( sprintf( 'Refunded %s on order %d (%s)', $amount, $order_id, $reason ) );
}
{gateway_id}_post_payment_completeAction
Per-gateway equivalent of redsys_post_payment_complete. Each non-redirect gateway fires its own action so you can hook only the payment method you care about. The hook name is built from the gateway id, for example bizum_post_payment_complete or insite_post_payment_complete.
Concrete hook names found in the source:
bizum_post_payment_complete (Bizum redirect and Bizum checkout)
directdeb_post_payment_complete (Direct Debit)
imap_post_payment_complete (IMAP bank reconciliation)
Built dynamically from $this->id in Apple Pay and Google Pay (checkout / redirection / blocks support), resolving to applepayredsys_post_payment_complete, googlepayredsys_post_payment_complete and googlepayredirecredsys_post_payment_complete.
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id.
Source: classes/class-wc-gateway-bizum-redsys.php:1515 (and equivalent calls in each gateway class).
PHP
// React only to successful Bizum payments.
add_action( 'bizum_post_payment_complete', 'my_bizum_complete', 10, 1 );
function my_bizum_complete( $order_id ) {
// Custom logic for Bizum-paid orders.
}
{gateway_id}_post_payment_errorAction
Per-gateway equivalent of redsys_post_payment_error. Each non-redirect gateway fires its own error action. The hook name is built from the gateway id, for example bizum_post_payment_error or insite_post_payment_error.
Concrete hook names found in the source:
bizum_post_payment_error
directdeb_post_payment_error
insite_post_payment_error
masterpass_post_payment_error
paygold_post_payment_error
Built dynamically from $this->id in Apple Pay and Google Pay, resolving to applepayredsys_post_payment_error, googlepayredsys_post_payment_error and googlepayredirecredsys_post_payment_error.
Parameters
Name
Type
Description
$order_id
int
The WooCommerce order id.
$error
string
A human-readable error message or reason.
Source: classes/class-wc-gateway-bizum-redsys.php:1557 (and equivalent calls in each gateway class).
PHP
add_action( 'insite_post_payment_error', 'my_insite_error', 10, 2 );
function my_insite_error( $order_id, $error ) {
error_log( sprintf( 'inSite error on order %d: %s', $order_id, $error ) );
}
redsys_payment_fieldsAction
Fires inside the main Redsys gateway's payment_fields() output, at the point where the checkout payment-method description and saved-card UI are rendered. Use it to print extra content (notices, custom inputs, trust badges) within the Redsys payment area at classic checkout.
Filters whether a given gateway should remain available when the cart contains a product flagged for pre-authorization. By default only gateways that declare supports( 'redsys_preauth' ) survive; return a truthy value to force-allow a specific gateway id. Note the value passed in as the first argument is the gateway id (string), and the callback's return value is evaluated as a boolean.
Parameters
Name
Type
Description
$gateway_id
string
The gateway id being evaluated. Return true to keep this gateway available for pre-auth carts, or false to leave the default behaviour.
Filters whether a given gateway should remain available when the cart requires tokenization (recurring / saved card). By default only gateways that declare supports( 'redsys_token_r' ) survive; return a truthy value to force-allow a specific gateway id.
Parameters
Name
Type
Description
$gateway_id
string
The gateway id being evaluated. Return true to keep this gateway available for tokenization carts.
Filters the order status used when a Redsys payment is left in a pending state (for example while awaiting confirmation). Return a different WooCommerce status slug to override the default pending status applied to such orders.
Parameters
Name
Type
Description
$status
string
The pending status slug to be applied. Return the (possibly modified) status.
Filters the transaction / order number sent to Redsys for an order. Redsys requires a numeric order reference with strict formatting; use this filter if you need to customize how the reference is generated (for example to integrate with a sequential invoice numbering plugin).
Parameters
Name
Type
Description
$transaction_id2
string
The computed Redsys order number. Return the (possibly modified) order number.
add_filter( 'redsys_order_number', 'my_order_number', 10, 3 );
function my_order_number( $transaction_id2, $order_id, $gateway ) {
// Keep Redsys formatting rules in mind (numeric, length limits).
return $transaction_id2;
}
redsys_product_descriptionFilter
Filters the product description string (Ds_Merchant_ProductDescription) sent to Redsys for an order. Useful to customize what appears on the bank's terminal / cardholder statement.
Parameters
Name
Type
Description
$description
string
The product description. Return the (possibly modified) description.
add_filter( 'redsys_refund_filter', 'my_refund_filter', 10, 1 );
function my_refund_filter( $array ) {
// Inspect or tweak refund data before it is sent.
return $array;
}
IPN / notifications 3
valid_{gateway_id}_standard_ipn_requestAction
Fires when a valid IPN (Instant Payment Notification, the asynchronous server-to-server callback from Redsys) has been received and verified for a gateway. The hook name is built dynamically from the gateway id, so it resolves to names such as valid_insite_standard_ipn_request, valid_bizumredsys_standard_ipn_request, valid_paygold_standard_ipn_request, valid_directdebitredsys_standard_ipn_request, valid_masterpass_standard_ipn_request, and the Apple Pay / Google Pay variants. The raw notification payload ($_POST) is passed so you can perform your own processing on every verified IPN.
Parameters
Name
Type
Description
$post
array
The raw $_POST array received from Redsys for the verified notification.
Source: classes/class-wc-gateway-insite-redsys.php:9346 (and equivalent calls in each gateway class).
Fires when a valid IPN has been received and verified for the main Redsys (redirect / credit card) gateway. Note that this concrete hook name uses hyphens, unlike the underscore-based dynamic variants above.
Dynamic icon filter built from the gateway id. The plugin's gateway classes and blocks-support classes expose icon filters named after each gateway id, so concrete names include woocommerce_bizumredsys_icon, woocommerce_directdebitredsys_icon, woocommerce_inespayredsys_icon, woocommerce_applepayredsys_icon, woocommerce_googlepayredsys_icon, and woocommerce_googlepayredirecredsys_icon.
Parameters
Name
Type
Description
$logo_url
string
The icon URL. Return the (possibly modified) URL.
Source: includes/blocks/class-wc-gateway-bizum-support.php:86 (and equivalent calls per gateway). In several gateway classes the dynamic icon is also fired via the woocommerce_{gateway_id}_iconn variant (see below).
Dynamic icon filter with a trailing double n, used inside several gateway classes (Bizum, Bizum checkout, Direct Debit, Apple Pay, Google Pay checkout/redirection). This is documented as-is because it exists in the source; it resolves to names such as woocommerce_directdebitredsys_iconn, woocommerce_applepayredsys_iconn, woocommerce_googlepayredsys_iconn, etc. Most front-end icon rendering also exposes the correctly-spelled woocommerce_{gateway_id}_icon via the blocks support classes, so prefer that one where available.
Parameters
Name
Type
Description
$logo_url
string
The icon URL. Return the (possibly modified) URL.
Source: classes/class-wc-gateway-direct-debit-redsys.php:255 (and equivalent calls per gateway).
Filters the full array of arguments (the Redsys request parameters) assembled before a payment is sent to the bank, for the gateways that use the shared redsys argument set (the main gateway, Bizum, Bizum checkout, Bank Transfer, and Direct Debit). Use it to add or override Redsys merchant parameters (Ds_Merchant_*).
Parameters
Name
Type
Description
$redsys_args
array
The Redsys request arguments. Return the (possibly modified) array.
Source: classes/class-wc-gateway-bizum-redsys.php:990 (and other locations including the main gateway, Bank Transfer, and Direct Debit classes).
PHP
add_filter( 'woocommerce_redsys_args', 'my_redsys_args', 10, 1 );
function my_redsys_args( $redsys_args ) {
// Add or modify Ds_Merchant_* parameters.
return $redsys_args;
}
woocommerce_{gateway_id}_argsFilter
Dynamic version of the request-args filter, built from the gateway id for gateways that maintain their own argument set (MasterPass, Apple Pay checkout, Google Pay checkout, Google Pay redirection). Concrete names include woocommerce_masterpass_args, woocommerce_applepayredsys_args, woocommerce_googlepayredsys_args, and woocommerce_googlepayredirecredsys_args.
Parameters
Name
Type
Description
$redsys_args
array
The Redsys request arguments. Return the (possibly modified) array.
Source: classes/class-wc-gateway-apple-pay-checkout.php:1533 (and equivalent calls per gateway).
Filters the label text of the "Add card" action presented to customers in the My Account area when they can store a new card token.
Parameters
Name
Type
Description
$text
string
The button/label text. Return the (possibly modified) text.
Source: classes/class-wc-gateway-redsys.php:5612.
PHP
add_filter( 'text_add_card_my_account', 'my_add_card_text', 10, 1 );
function my_add_card_text( $text ) {
return __( 'Save a new card', 'my-textdomain' );
}
redsys_text_get_tokenFilter
Filters the text shown to the customer offering to save / tokenize their card during checkout (the "store this card" wording). Applied across the main, inSite and blocks-support contexts.
Parameters
Name
Type
Description
$text
string
The tokenization prompt text. Return the (possibly modified) text.
Source: classes/class-wc-gateway-redsys.php:5586 (and other locations including inSite and blocks support classes).
PHP
add_filter( 'redsys_text_get_token', 'my_get_token_text', 10, 1 );
function my_get_token_text( $text ) {
return __( 'Remember my card for next time', 'my-textdomain' );
}
redsys_text_preauthFilter
Filters the text shown to the customer explaining a pre-authorization (authorization-only) charge at checkout.
Parameters
Name
Type
Description
$text
string
The pre-authorization explanatory text. Return the (possibly modified) text.
Source: classes/class-wc-gateway-redsys.php:5596 (and other locations including inSite and blocks support classes).
PHP
add_filter( 'redsys_text_preauth', 'my_preauth_text', 10, 1 );
function my_preauth_text( $text ) {
return __( 'Your card will be authorized, not charged, until we ship.', 'my-textdomain' );
}
redsys_disable_remote_token_removalFilter
Since: 23.0.0
Filters whether the plugin should skip removing a stored card token on the Redsys side when an unexpected token-removal notification arrives. It defaults to true (remote removal disabled) as a safety guard while unexpected removals are investigated. Return false to allow the remote token to be deleted.
Parameters
Name
Type
Description
$disabled
bool
Whether remote removal is disabled. Return true to keep the token, false to allow remote deletion.
Filters the data used to build the e-mail that invites a customer to add / register a card token (subject, body, headers, recipient, etc.). Use it to customize the wording or routing of the token-request e-mail.
Parameters
Name
Type
Description
$data
array
Associative array with keys such as user_id, email, name, last_name, site_title, user_link, subject, body, headers. Return the (possibly modified) array.
Source: classes/class-wc-redsys-profile.php:125 (and 1 other location in the same file).
Fires after the gateway processes the saving of custom order fields, passing the submitted data. Use it to persist your own order meta based on the posted values during checkout / order processing.
Parameters
Name
Type
Description
$data
array
The submitted data ($_POST or a derived data array, depending on call site).
Source: classes/class-wc-gateway-redsys.php:10954 (and 3 other locations across the main and inSite gateway classes).
PHP
add_action( 'save_field_update_order_meta', 'my_save_order_fields', 10, 1 );
function my_save_order_fields( $data ) {
// Inspect $data and store your own order meta if needed.
}
redsys_kses_descripcionFilter
Filters the list of allowed HTML tags/attributes used to sanitize the gateway description rendered at checkout (passed to wp_kses). Use it to allow additional safe markup in the payment-method description.
Parameters
Name
Type
Description
$allowed_html
array
The wp_kses allowed-HTML array. Return the (possibly modified) array.
Source: classes/class-wc-gateway-redsys.php:5516 (and other locations across the inSite, Bizum checkout, Apple Pay and Google Pay classes).
Filters whether a WordPress/WooCommerce account may be created automatically during an Apple Pay (classic checkout) purchase. Defaults to WooCommerce's registration setting; return true/false to override.
Parameters
Name
Type
Description
$registration_enabled
bool
Whether account creation is allowed. Return the (possibly modified) boolean.
Source: classes/class-wc-gateway-apple-pay-checkout.php:1963 (and 1 other location in the same file).
Filters whether the handoff signature verification should be skipped for a UCP session. Defaults to false (signature is verified). Return true to skip it (not recommended in production).
Parameters
Name
Type
Description
$skip
bool
Whether to skip the check. Return the (possibly modified) boolean.
Filters whether insecure (non-HTTPS) transport is allowed for ACP/MCP authentication requests. Defaults to false. Return true only in trusted development environments.
Parameters
Name
Type
Description
$allow
bool
Whether insecure transport is allowed. Return the (possibly modified) boolean.