gform_post_payment_completed

Description

Triggers when a payment has been completed through the form.

Usage

add_action( 'gform_post_payment_completed', 'my_function', 10, 2 );

Parameters

  • $entry Entry Object

    The entry object that was created.

  • $action array

    The action that occurred. Contains things such as the amount, what occurred, and the transaction ID.

$action = array(
	'type'             => '',
	'amount'           => '',
	'transaction_type' => '',
	'transaction_id'   => '',
	'subscription_id'  => '',
	'entry_id'         => '',
	'payment_status'   => '',
	'note'             => '',
);

Examples

add_action( 'gform_post_payment_completed', function ( $entry, $action ) {
	
    // Do something here.

    // If data from the Stripe webhook event is needed (and this hook was initiated via a Stripe webhook request), you can access event data with the following line:
    $event = gf_stripe()->get_webhook_event();
    if ( $event ){
       // Access webhook event data. For event object documentation, see: https://stripe.com/docs/api/events/object
    }    

}, 10, 2 );

Source Code

do_action( 'gform_post_payment_completed', $entry, $action );

This action hook is located in GFPaymentAddOn::complete_payment() in includes/addon/class-gf-payment-addon.php.