Description
The gravityflowwoocommerce_payment_step_started allows developers perform custom actions (such as logging, notifications, or integration tasks) right when the payment step begins processing an entry.
Usage
add_filter( 'gravityflowwoocommerce_payment_step_started', 'custom_function', 10, 3 );
Parameters
| Parameter | Type | Details |
|---|---|---|
| $entry | array | The current Gravity Forms entry. |
| $form | array | The current Gravity Forms form. |
| $step | object | The current Gravity Flow step. |
Examples
Perform custom actions when a payment step starts.
add_action( 'gravityflowwoocommerce_payment_step_started', 'gfw_payment_step_started', 10, 3 );
function gfw_payment_step_started( $entry, $form, $step ) {
// Add a note to the workflow
gravity_flow()->add_timeline_note( 'Payment started for '.$entry['id']);
// Send custom notification
wp_mail( '[email protected]', 'Payment Step Started', 'Entry #' . $entry['id'] . ' has reached the payment step.' );
// Update custom meta
update_post_meta( $entry['id'], '_payment_step_started', current_time( 'mysql' ) );
}
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 includes/steps/class-step-woocommerce-payment.php