gravityflowstripe_pre_cancel_workflow

Description

The gravityflowstripe_pre_cancel_workflow action fires just before a workflow is marked as cancelled due to a failed Stripe payment. It allows developers to run custom logic such as sending notifications, logging details, or updating entry meta, before the workflow is stopped.

Usage

1
add_action( 'gravityflowstripe_pre_cancel_workflow', 'my_custom_pre_cancel_action' );

Parameters

ParameterTypeDescription
$entryEntry ObjectThe entry associated with the failed Stripe payment and the workflow being cancelled.

Examples

1
2
3
4
5
6
7
8
add_action( 'gravityflowstripe_pre_cancel_workflow', 'my_custom_pre_cancel_action' );
 
function my_custom_pre_cancel_action( $entry ) {
    // Example: Log or notify before cancellation
    GFCommon::log_debug( 'Stripe payment failed for entry ID: ' . rgar( $entry, 'id' ) );
 
    // You can also trigger custom integrations here
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in gravityflowstripe/class-stripe.php