Skip to content

Action and Filter Hooks

Adam Heckler edited this page Dec 19, 2024 · 1 revision

This page describes all the action and filter hooks available to you if you need to manipulate how the Stripe extension functions.

Note

We are unable to provide support for custom code under our Support Policy. If you need assistance with custom code, we highly recommend Codeable or a Certified WooExpert.

Action Hooks

Hook Name Parameter(s) Description
wc_gateway_stripe_process_response $stripe_response
$order
The response we get back after calling a charge request to Stripe.
woocommerce_credit_card_form_start $gateway_id Before showing the credit card form.
woocommerce_credit_card_form_end $gateway_id After showing the credit card form.
wc_gateway_stripe_process_payment $stripe_response
$order
The response we get back after calling a charge request to Stripe but before processing the actual response.
wc_gateway_stripe_process_payment_error $error
$order
Called when an error occurs during the process payment event.
woocommerce_stripe_add_customer $args
$response
Called after creating a Stripe customer.
woocommerce_stripe_add_source $stripe_customer_id
$wc_token
$response
$source_id
Called after creating/attaching a source to a customer.
wc_stripe_delete_source $stripe_customer_id
$response
Called after deleting a source from customer.
wc_stripe_set_default_source $stripe_customer_id
$response
Called after setting a default source to a customer.
wc_gateway_stripe_process_redirect_payment $response
$order
Called after a redirect payment process.
wc_gateway_stripe_process_redirect_payment_error $error
$order
Called after a failed redirect payment process.
woocommerce_stripe_process_manual_capture $order
$result
Called after a manual capture of a charge within admin order.
woocommerce_stripe_process_manual_cancel $order Called after a cancel of the order that is authorized and not yet captured.
wc_gateway_stripe_process_webhook_payment $response
$order
Called after a webhook payment process.
wc_gateway_stripe_process_webhook_payment_error $order
$notification
$e
Called after a webhook payment process error.

Filter Hooks

Hook Name Parameter(s) Description
wc_stripe_save_to_account_text $text Text that shows to customers next to the save payment information checkbox.
wc_stripe_payment_icons $icons_array Icons that show next to each payment method.
wc_stripe_send_stripe_receipt $bool Whether to send a receipt via Stripe.
wc_stripe_payment_metadata $metadata
$order
$prepared_source
Metadata that gets passed during an express checkout.
wc_stripe_generate_payment_request $post_data
$order
$prepared_source
Post data that gets passed during an express checkout.
wc_stripe_owner_details $details
$order
The owner details of an order.
wc_stripe_force_save_source $force_save_source
$customer
Override force save customer.
wc_stripe_use_default_customer_source $use_default Whether to use default customer source if source not found.
wc_stripe_refund_request $request
$order
Request parameters when refund is requested.
wc_stripe_PAYMENT_METHOD_settings $settings Admin settings for payment method.
wc_stripe_description $description
$payment_method_id
Override the description of credit card payments.
wc_stripe_display_save_payment_method_checkbox $bool Whether to show the save payment method checkbox.
wc_stripe_sepa_mandate_notification $method The method to use to inform customer of the SEPA mandate.
wc_stripe_allow_prepaid_card $bool Whether to allow prepaid credit card to be used.
wc_stripe_elements_options Additional options to manipulate Stripe elements.
wc_stripe_elements_styling Additional options to manipulate the Stripe elements styling.
wc_stripe_elements_classes Additional options to add classes to the Stripe elements.
wc_stripe_params $params Localized JS key/value pair.
wc_stripe_payment_request_params $params Localized JS key/value pair.
wc_stripe_hide_display_order_fee $bool
$order_id
Whether to hide the display order fee in orders view.
wc_stripe_hide_display_order_payout $bool
$order_id
Whether to hide the display order payout in orders view.
woocommerce_stripe_request_headers $headers_args Headers parameters for cURL requests.
wc_stripe_idempotency_key $key_string
$request
The string for the idempotency key on request.
woocommerce_stripe_request_body $request
$api
The request body to pass when doing a request.
wc_stripe_customer_metadata $metadata
$user
The meta data used when creating a customer.
wc_stripe_create_customer_args $args The arguments used when creating a customer.
wc_stripe_localized_messages $localized_messages The messages used from Stripe responses.
wc_stripe_logging $bool
$message
Whether to log a specific message when logging is enabled.
wc_stripe_webhook_review_change_order_status $bool
$order
$notification
Whether to change the order status when order review event happens.
wc_stripe_PAYMENT_METHOD_supported_currencies $currencies The supported currencies for that specific payment method.
wc_stripe_payment_request_total_label_suffix $suffix Label suffix to use when express checkout is engaged.
wc_stripe_payment_request_total_label $label The total label to use when express checkout is engaged.
wc_stripe_payment_request_supported_types $types The product types express checkout supports.
wc_stripe_hide_payment_request_on_product_page $bool Whether to hide express checkout button on product detail page.
wc_stripe_show_payment_request_on_checkout $bool Whether to show express checkout button on checkout page.
wc_stripe_payment_request_hide_itemization $bool Whether to show itemizations when using express checkouts.
wc_stripe_save_to_subs_text $text Text that shows to customers next to the checkbox to update all active subscriptions with the new saved card.
wc_stripe_save_to_subs_checked $bool Whether to have the checkbox to update all active subscriptions with the new saved card be checked by default.
wc_stripe_update_subs_payment_method_card_statuses $statuses Which subscriptions will have their payment method updated if the customer chose that option when adding a new payment method. By default, only the “active” subscriptions will be updated.
wc_stripe_show_payment_request_on_cart $bool Manage the display of payment request buttons in cart
Clone this wiki locally