bookmark_bordergform_payment_methods

Description

Use this filter to add alternative payment methods to the Credit Card field.

Usage

add_filter( 'gform_payment_methods', 'your_function_name', 10, 3 );

Parameters

  • $payment_methods array

    Array containing other loaded payment methods.

  • $field Field Object

    The current field.

  • $form_id integer

    The ID of the current form.

Examples

This example adds a payment method named Test Payment.

add_filter( 'gform_payment_methods', 'add_payment', 10, 3 );
function add_payment( $payment_methods, $field, $form_id ) {
    $payment_methods[] = array( 'key' => 'testing', 'label' => 'Test Payment' );
    return $payment_methods;
}

Placement

This code should be placed in the functions.php file of your active theme. If you are creating a plugin to integrate with Gravity Forms, this filter would go in your plugin file.

Source Code

This filter is located in GF_Field_CreditCard::get_field_input() in includes/fields/class-gf-field-creditcard.php