Description
The “gform_stripe_checkout_options” JavaScript based filter in the Gravity Forms Stripe add-on allows for altering the checkout options just before the Stripe checkout modal is loaded. This filter can only be used if you’re using the Stripe Checkout payment method in your Stripe add-on settings.
Usage
The following would apply to all forms:
gform.addFilter( 'gform_stripe_checkout_options', function( options, formId ) { return options; } );
Example
The following would dynamically populate the email field in the Stripe Checkout modal with the value entered into an email field. In the snippet below change the number 8 in {:8}
to be the field ID of an email field on your form.
gform.addFilter( 'gform_stripe_checkout_options', function( options, formId ) { options.email = GFMergeTag.replaceMergeTags( formId, '{:8}' ); return options; } );
Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Since
This filter was added in Stripe 2.6 and removed in Stripe 3.0
Source Code
This filter is located in js/frontend.js