gform_paypal_get_payment_feed

gform_paypal_get_payment_feed

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows the filtering of return configuration feeds.
Usage
add_filter( 'gform_paypal_get_payment_feed', 'your_function_name', 10, 3 );

Parameters

$feed Feed Object
The current feed.

$entry Entry Object
The current entry.

$form Form Object
The current form.

Examples
add_filter( 'gform_paypal_get_payment_feed', 'change_feed', 10, 3 );
function change_feed( $feed, $entry, $form ){
$feed['meta']['feedName'] = 'Testing';
return $feed;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms PayPal Standard version 2.2.
Source Code
This filter is located in GFPayPal::get_payment_feed() in gravityformspaypal/class-gf-paypal.php.

gform_paypal_fulfillment

gform_paypal_fulfillment

DescriptionUsageParametersExamplesPlacementSource Code

Description
This hook runs when a transaction is completed successfully for the PayPal Standard Add-on and can be used to fire actions dependent on a successful PayPal transaction.
Usage
add_action( 'gform_paypal_fulfillment', 'your_function_name', 10, 4 );

Parameters

$entry Entry Object
The entry used to generate the PayPal transaction.

$feed Feed Object
The PayPal Feed configuration data used to generate the order.

$transaction_id string
The transaction ID returned by PayPal.

$amount float
The amount of the transaction returned by PayPal.

Examples
Below is a fictional example of adding a successful order to a third party order fulfillment system.
add_action( 'gform_paypal_fulfillment', 'process_order', 10, 4 );
function process_order( $entry, $feed, $transaction_id, $amount ) {

// get first and last name from $entry
$order_id = rgar( $entry, 'id' );
$first_name = rgar( $entry, '2.3' );
$last_name = rgar( $entry, '2.6' );

// use fictional function to add order to fictional My Third Party application
mtp_add_order( $transaction_id, $amount, $order_id, $first_name, $last_name );

}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
do_action( 'gform_paypal_fulfillment', $entry, $feed, $transaction_id, $amount )

This hook is located in GFPayPal::fulfill_order() in class-gf-paypal.php.

gform_{$SHORT_SLUG}_field_value

gform_{$SHORT_SLUG}_field_value

DescriptionShort Slug ValuesUsageParametersExamples1. ActiveCampaign – Use Choice Text Instead of Value2. ActiveCampaign – Replace Commas with Pipes3. Emma – Format Checkbox Field4. Help Scout – Change Value of Specific Field5. Zoho CRM – Format Date Field6. Zoho CRM – Format Checkbox FieldPlacementSinceSource Code

Description
This filter can be used to modify a value before it is sent to a third-party by one of the Add-On Framework based add-ons. If you want to filter the value for any add-on you can use gform_addon_field_value.
Short Slug Values
The Gravity Forms Add-On Slugs article lists the available short slugs to use with this hook:
The following add-ons listed in the slug article do not use the hook:

Gravity Forms CLI Add-On
Gravity Forms Debug Add-On
Gravity Forms Gutenberg Add-On

The Zapier Add-On implements its own version of the hook:

gform_zapier_field_value

Usage
The base filter which would run for all forms and all fields would be used like so:
1add_filter( 'gform_helpscout_field_value', 'your_function_name', 10, 4 );
To target a specific form append the form id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID)
1add_filter( 'gform_helpscout_field_value_10', 'your_function_name', 10, 4 );
To target a specific field append both the form id and the field id to the hook name. (format: gform_{$SHORT_SLUG}_field_value_FORMID_FIELDID)
1add_filter( 'gform_helpscout_field_value_10_3', 'your_function_name', 10, 4 );

Parameters

$value string
The value to be modified.

$form Form Object
The form currently being processed.

$entry Entry Object
The entry currently being processed.

$field_id string
The ID of the field currently being processed.

Examples
1. ActiveCampaign – Use Choice Text Instead of Value
This example shows how you can replace the value of a choice based survey field with the choice text.
1234567891011add_filter( 'gform_activecampaign_field_value', 'gf_get_choice_text', 10, 4 );function gf_get_choice_text( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'survey' ) {        $value = $field->get_value_export( $entry, $field_id, true );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }    return $value;}
2. ActiveCampaign – Replace Commas with Pipes
This example shows how you can replace the commas used to separate checkbox or multi select choices with pipe characters.
123456789101112add_filter( 'gform_activecampaign_field_value', 'gf_replace_commas_with_pipes', 10, 4 );function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {    gf_activecampaign()->log_debug( __METHOD__ . '(): running.' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {        $value = str_replace( ', ', '||', $value );        gf_activecampaign()->log_debug( __METHOD__ . '(): Value: ' . $value );    }     return $value;}
3. Emma – Format Checkbox Field
This example shows how you can reformat the checkbox field value to be passed as an array instead of a string.
123456789add_filter( 'gform_emma_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        $value = explode( ', ', $value );    }     return $value;}, 10, 4 );
4. Help Scout – Change Value of Specific Field
This example shows how you can change the value of field 3 on form 10 before it is passed to Help Scout.
1234add_filter( 'gform_helpscout_field_value_10_3', function ( $value, $form, $entry, $field_id ) {     return 'your new value';}, 10, 4 );
5. Zoho CRM – Format Date Field
This example shows how you can reformat the entry date from yyyy-mm-dd to the format configured on the field.
123456789add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->type == 'date' ) {        $value = GFCommon::date_display( $value, $field->dateFormat );    }     return $value;}, 10, 4 );
6. Zoho CRM – Format Checkbox Field
This example shows how you can reformat the checkbox field value to pass true or false instead of the choice. This snippet is not needed if you』re using version 1.8 of the add-on or newer.
1234567891011add_filter( 'gform_zohocrm_field_value', function ( $value, $form, $entry, $field_id ) {    gf_zohocrm()->log_debug( __METHOD__ . '(): Running...' );    $field = GFAPI::get_field( $form, $field_id );     if ( is_object( $field ) && $field->get_input_type() === 'checkbox' ) {        gf_zohocrm()->log_debug( __METHOD__ . '(): Checkbox value to true or false.' );        $value = $value ? 'true' : 'false';    }     return $value;}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 1.9.10.11.
Source Code
1234gf_apply_filters( "gform_{$slug}_field_value", array(    $form['id'],    $field_id), $field_value, $form, $entry, $field_id );
This filter is located in GFAddOn::maybe_override_field_value() in includes/addon/class-gf-addon.php.

gform_paypal_feed_settings_fields

gform_paypal_feed_settings_fields

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
This filter allows adding custom settings fields to PayPal Standard.
Usage
1add_filter( 'gform_paypal_feed_settings_fields', 'your_function_name', 10, 2 );

Parameters

$default_settings array
The default feed settings.

$form Form Object
The current form.

Examples
123456789101112add_filter( 'gform_paypal_feed_settings_fields', 'add_custom_setting', 10, 2 );function add_custom_setting( $default_settings, $form ){    $default_settings[0]['fields'][] = array(        'name' => 'Testing',        'label' => 'Testing Label',        'type' => 'text',        'class' => 'medium',        'required' => true,        'tooltip' => '

Testing. Test

'    );    return $default_settings;}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms PayPal Standard version 2.2.
Source Code
This filter is located in GFPayPal::feed_settings_fields() in class-gf-paypal.php.

gform_paypal_config_validation

gform_paypal_config_validation

DescriptionUsageParametersExamplesSource Code

Description
Used to validate custom settings/meta specified using the gform_paypal_action_fields or gform_paypal_add_option_group action hooks.
Usage
add_filter( 'gform_paypal_config_validation', 'your_function_name' );

Parameters

$is_validation_error boolean
Boolean value indicating whether there was a validation error with the PayPal configuration.

$feed Feed Object
The PayPal feed configuration array.

Examples
This example shows how to validate fictional custom options added to integrate with a fictional third party application. This assumes that the custom fields were added to the PayPal configuration form using the gform_paypal_action_fields or gform_paypal_add_option_group hook.
add_filter( 'gform_paypal_config_validation', 'validate_custom_config', 10, 2 );
public static function validate_custom_config( $is_validation_error, $feed ) {

$custom_options = rgars( $feed, 'meta/custom_options' );

if ( empty( $custom_options['enable_thirdparty_options'] ) )
return $is_validation_error;

if ( empty( $custom_options['thirdparty_apikey'] ) || empty( $custom_options['thirdparty_apipass'] ) )
return true;

return $is_validation_error;
}

Source Code
apply_filters( 'gform_paypal_config_validation', false, $feed )

This action hook is located in GFPayPal::save_feed_settings() class-gf-paypal.php.

gform_paypal_business_email

gform_paypal_business_email

DescriptionUsageParametersExamplesPlacementSource Code

Description
Allows changes to be made to the PayPal business email while validating the IPN from PayPal.
Usage
1add_filter( 'gform_paypal_business_email', 'your_function_name', 10, 3 );

Parameters

$paypalEmail bool
The PayPal email.

$feed Feed Object
The current feed.

$entry Entry Object
The current entry.

Examples
12345add_filter( 'gform_paypal_business_email', 'change_email', 10, 3 );function change_email( $paypalEmail, $feed, $entry ){    $paypalEmail = '[email protected]';    return $paypalEmail;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFPayPal::can_process_ipn() in gravityformspaypal/class-gf-paypal.php.

gform_paypal_add_option_group

gform_paypal_add_option_group

DescriptionUsageParametersExamplesSource Code

Description
This hook is used to add groups of options to the PayPal feed.
Usage
1add_filter( 'gform_paypal_add_option_group', 'your_function_name', 10, 2 );

Parameters

$feed Feed Object
The configuration details for the current feed. This will be empty when initially creating a new form.

$form Form Object
The form for the current feed. This will be empty when initially creating a new form.

Examples
This example adds a group of checkbox fields which would allow the user to enable/disable a group of custom options.
1234567891011121314151617181920212223add_filter( 'gform_paypal_add_option_group', 'add_paypal_option_group', 10, 2 );function add_paypal_options( $feed, $form ) {    ?>     

                  

                

  •                                             
  •             

  •                                             
  •         

     

     get_current_feed(), $this->get_current_form() )
This filter is located in GFPayPal::settings_custom() in class-gf-paypal.php.

gform_paypal_action_fields

gform_paypal_action_fields

DescriptionUsageParametersExamplesSource Code

Description
This hook is used add individual options to the PayPal feed.
Usage
1add_action( 'gform_paypal_action_fields', 'add_paypal_options', 10, 2 );

Parameters

$feed Feed Object
The configuration details for the current feed. This will be empty when initially creating a new form.

$form Form Object
The form for the current feed. This will be empty when initially creating a new form.

Examples
This example adds a checkbox field which would enable/disable a custom option.
1234567891011add_action( 'gform_paypal_action_fields', 'add_paypal_options', 10, 2 );function add_paypal_options( $feed, $form ) {    ?>     

  •                     
  •      get_current_feed(), $this->get_current_form() )
    This filter is located in GFPayPal::settings_options() in class-gf-paypal.php.

    gform_payment_transaction_id

    gform_payment_transaction_id

    DescriptionUsageParametersExamplesPlacementSource Code

    Description
    Allows the payment transaction id displayed for the entry in the Payment Details section to be modified.
    Usage
    add_filter( 'gform_payment_transaction_id', 'your_function_name', 10, 3 );

    Parameters

    $transaction_id int
    The payment transaction id for the entry.

    $form Form Object
    The form.

    $entry Entry Object
    The entry.

    Examples
    add_filter( 'gform_payment_transaction_id', 'change_transaction_id', 10, 3 );
    function change_transaction_id( $transaction_id, $form, $entry ){
    $transaction_id= 5;
    return $transaction_id;
    }

    Placement
    This code should be placed in the functions.php file of your active theme.
    Source Code
    This filter is located in GFEntryDetail::meta_box_payment_details() in entry_detail.php.

    gform_payment_statuses

    gform_payment_statuses

    DescriptionUsageParametersExamplesPlacementSinceSource Code

    Description
    The 「gform_payment_statuses」 filter in Gravity Forms allows custom payment statuses to be defined.
    Usage
    1add_filter( 'gform_payment_statuses', 'your_function_name', 10, 1 );

    Parameters

    $payment_statuses array
    An array of entry payment statuses with the entry value as the key (15 char max) to the text for display.

    Examples
    123456add_filter( 'gform_payment_statuses', 'add_new_status', 10, 1 );function add_new_status( $payment_statuses ){    $payment_statuses['Tested'] = 'Tested';    return $payment_statuses; }
    Placement
    This code should be placed in the functions.php file of your active theme.
    Since
    This filter was added in Gravity Forms 2.4.
    Source Code
    This filter is located in GFCommon::get_entry_payment_statuses() in gravityforms/common.php.