Using Gravity Forms ‘gform_ppcp_disable_funding’ PHP action

The gform_ppcp_disable_funding action allows you to disable specific funding sources when using the PayPal Checkout method on the PayPal Field with the PayPal Checkout Add-On.

Usage

To apply this action to all forms, use the following code:

add_filter('gform_ppcp_disable_funding', 'your_function_name');

Parameters

  • $disabled_funding (array): An array of disabled funding sources. Defaults to an empty array. Possible values are: card, credit, paylater, bancontact, blik, eps, giropay, ideal, mercadopago, mybank, p24, sepa, sofort, venmo. See the PayPal Checkout developer documentation for the latest updates.

More information

See Gravity Forms Docs: gform_ppcp_disable_funding

Examples

Disable SEPA

This example disables SEPA-Lastschrift as a funding source.

add_filter('gform_ppcp_disable_funding', 'ppcp_disable_sepa');

function ppcp_disable_sepa($disabled_funding) {
    $disabled_funding[] = 'sepa';
    return $disabled_funding;
}

Disable Pay Later / PayPal Credit

This example disables Pay Later, PayPal Credit, Pay in 4, 4X PayPal, and Später Bezahlen as funding sources.

add_action('gform_ppcp_disable_funding', function($disabled_funding) {
    $disabled_funding[] = 'credit'; // PayPal Credit (US, UK).
    $disabled_funding[] = 'paylater'; // Pay Later (US, UK), Pay in 4 (AU), 4X PayPal (France), Später Bezahlen (Germany).
    return $disabled_funding;
});

Placement: This code should be placed in the functions.php file of your active theme.

Since: This hook was added in Gravity Forms 1.0.

Source Code: This filter is located in GF_PPCP::get_disable_funding() in class-gf-ppcp.php.