gform_ppcp_disable_funding

Description

This filter can be used to disable funding sources when using the PayPal Checkout method on the PayPal Field with the PayPal Checkout Add-On.

Usage

The following would apply to all forms:

add_filter( 'gform_ppcp_disable_funding', 'your_function_name' );

Parameters

PropertyTypeDescription
$disabled_fundingarrayAn array of disabled funding sources. Defaults to an empty array. The possible values are: card, credit, paylater, bancontact, blik, eps, giropay, ideal, mercadopago, mybank, p24, sepa, venmo.

See the PayPal Checkout developer documentation for the latest updates.

Note: Disabling paylater or credit hides the button and Pay Later messaging on your site, but PayPal may still present these options within the PayPal modal/checkout window. This is controlled by PayPal based on user location and eligibility and can’t be overridden by this filter.

Examples

Disable SEPA

This example shows how you can disable 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

add_filter( '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 can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

return implode( ',', apply_filters( 'gform_ppcp_disable_funding', $disabled_funding ) )

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

Since

This hook was added in the PayPal Checkout Add-On version 1.0.