gform_post_payment_callback

Description

Triggers right after the payment callback occurs when payments are processed.

Usage

add_action( 'gform_post_payment_callback', 'my_function', 10, 3 );

Parameters

ParameterTypeDescription
$entryEntry objectThe entry object that was created.
$actionarrayThe action that occurred. Contains things such as the amount, what occurred, and the transaction ID. See sample array structure below.
$resultmixedThe result of the payment, such as payment success or failure.

Sample $action

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

Possible values for type are:

  • complete_payment
  • refund_payment
  • fail_payment
  • add_pending_payment
  • void_authorization
  • create_subscription
  • cancel_subscription
  • expire_subscription
  • add_subscription_payment
  • fail_subscription_payment
  • fail_create_subscription

Examples

function my_function( $entry, $action, $result ) {
    // Do something here.
}
add_action( 'gform_post_payment_callback', 'my_function', 10, 3 );

Source Code

do_action( 'gform_post_payment_callback', $entry, $action, $result );

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