Using Gravity Forms ‘gform_{$short_slug}_is_valid_payment_amount’ PHP action

The gform_{$short_slug}_is_valid_payment_amount Gravity Forms PHP filter allows you to implement custom logic to determine if a payment add-on should process the submission for a given amount.

Usage

// Generic usage
add_filter('gform_stripe_is_valid_payment_amount', 'your_function_name', 10, 5);

// Specific form usage (form ID 10)
add_filter('gform_stripe_is_valid_payment_amount_10', 'your_function_name', 10, 5);

Parameters

  • $is_valid (bool): Indicates if the amount is valid for processing. Default is true when the amount is greater than zero.
  • $submission_data (Submission Data Object): Contains the form title, payment amount, setup fee amount, trial amount, line items created using the submitted pricing field values, and any discounts from coupons.
  • $feed (Feed Object): The feed to be processed.
  • $form (Form Object): The form currently being processed.
  • $entry (Entry Object): The temporary entry containing the submitted values.

More information

See Gravity Forms Docs: gform_{$short_slug}_is_valid_payment_amount

This filter was added in Gravity Forms 2.4.18.

Examples

Custom minimum amount for PayPal

Prevent the add-on from processing submissions where the amount is less than $1.

add_filter('gform_stripe_is_valid_payment_amount', function($is_valid, $submission_data) {
    return floatval($submission_data['payment_amount']) > 1;
}, 10, 2);