Charitable Documentation

Learn how to make the most of Charitable with clear, step-by-step instructions.

Hooks and filters in Stripe

Like all Charitable extensions, Charitable Stripe is designed to be developer-friendly and includes hooks and filters that will help you make any customizations you need.

Paid Extension

Charitable Stripe is a premium plugin. Get it today with one of our plugin bundles.


Filters

charitable_stripe_statement_descriptor

Added in version 1.3.0

Filter the automatically formatted statement descriptor that is sent to Stripe.

Note: This filter is only used when the statement descriptor’s Format setting (under Charitable > Settings > Payment Gateways > Stripe) is set to “Use campaign title”.

Return Value

String. By default, this returns the first 22 characters of the campaign title.

Arguments

  • $descriptor (string)

    The default descriptor.

  • $donation (Charitable_Donation)

    The donation object.

  • $processor (Charitable_Donation_Processor)

    The donation processor object.

Usage

add_filter(
    'charitable_stripe_statement_descriptor',
    function( $descriptor, Charitable_Donation $donation ) {
        return 'My Custom Statement Descriptor';
    },
    10,
    2
);

charitable_stripe_metadata_fields

Added in version 1.4.0

Filter the list of Donation Fields which will be sent to Stripe as the metadata for a particular one-time or recurring donation.

Return Value

An array of keys for Donation Fields.

Arguments

  • $fields (array)

    The keys of all Donation Fields that will have their values sent to Stripe. By default, this will include any field which is shown in the front-end donation form, as well as donation_id and donor.

Usage

/**
 * Add a new field to the metadata.
 */
add_filter(
    'charitable_stripe_metadata_fields',
    function( $fields ) {
        // Add the name(s) of the campaign(s) receiving the donation to the metadata
        $fields[] = 'campaign_categories_list';
        return $fields;
    }
);

/**
 * Remove a field from the metadata.
 */
add_filter(
    'charitable_stripe_metadata_fields',
    function( $fields ) {
        unset( $fields['address'] );
        return $fields;
    }
);

charitable_stripe_charge_metadata

Added in version 1.3.0

Filter the metadata passed to a Payment Intent, Checkout Session, or Charge.

Return Value

An array of metadata as key=>value pairs.

Arguments

  • $metadata (array)

    The set of metadata.

  • $donation (Charitable_Donation)

    The donation object.

  • $processor (Charitable_Donation_Processor)

    The processor object.

charitable_stripe_webhook_events

Added in version 1.3.0

Filter the list of webhook events that Charitable is subscribed to receive notifications for from Stripe.

Return Value

An array of valid webhook event types.

Arguments

  • $events (array)

    The events that the webhook will be notified about.

  • $connect_application (boolean)

    Whether this is a webhook for a Connect application.

charitable_stripe_setup_webhooks

Added in version 1.3.0

Filter whether webhooks should be set up for this site.

By default, this will return true unless this is localhost.

Return Value

Boolean.

Arguments

  • $setup_webhooks (boolean)

    Whether the webhooks should be set up.

Usage

add_filter( 'charitable_stripe_setup_webhooks', '__return_false' );

charitable_stripe_default_event_processors

Added in version 1.3.0

Modify the default event processors for specific webhook event types.

Return Value

A key=>value array of Stripe event types and associated callback functions.

Arguments

  • $processors (array)

    Array of Stripe event types and associated callback functions.

charitable_stripe_languages_directory

Added in version 1.0.0

Modify the directory where extension translations are stored.

Return Value

A string representing the path to the languages directory, relative to the wp-content/plugins directory.

Arguments

  • $directory (string)

    The language directory path. Defaults to charitable-stripe/languages.

charitable_gateway_stripe_name

Added in version 1.0.0

Filter the gateway name as it is displayed in the admin area.

Return Value

String. Defaults to “Stripe”.

Arguments

  • $name (string)

    Gateway name.

charitable_stripe_theme_template_path

Added in version 1.4.0

Filter the Stripe theme template path.

Return Value

A string representing the directory where theme templates are stored, relative to the theme folder.

Arguments

  • $template_path (string)

    The template path. Defaults to charitable/charitable-stripe.

charitable_stripe_gateway_processor_checkout

Added in version 1.4.0

Filter the processor class used for handling Checkout donations.

Return Value

A string representing the name of a class that descends from the Charitable_Stripe_Gateway_Processor base class. Defaults to Charitable_Stripe_Gateway_Processor_Checkout.

Arguments

  • $class (string)

    The name of the Stripe gateway processor class.

  • $processor (Charitable_Donation_Processor)

    The Donation Processor helper.

charitable_stripe_gateway_processor_payment_intents

Added in version 1.4.0

Filter the processor used for handling PaymentIntent donations.

Return Value

A string representing the name of a class that descends from the Charitable_Stripe_Gateway_Processor base class. Defaults to Charitable_Stripe_Gateway_Processor_Payment_Intents.

Arguments

  • $class (string)

    The name of the Stripe gateway processor class.

  • $processor (Charitable_Donation_Processor )

    The Donation Processor helper.

charitable_stripe_customer_args

Added in version 1.2.2

Filter the Stripe customer arguments.

Return Value

An array of arguments which will be passed to a \Stripe\Customer::create() call.

Arguments

  • $args (array)

    The customer arguments.

  • $donor (Charitable_Donor)

    The Donor object.

charitable_stripe_session_args

Added in version 1.4.0

Filter the Session arguments.

Return Value

An array of arguments that will be used in a call to \Stripe\Checkout\Session::create().

Arguments

  • $args (array)

    The Session args.

  • $donation (Charitable_Donation)

    The donation object.

  • $processor (Charitable_Donation_Processor)

    The processor object.

  • $gateway (Charitable_Gateway_Stripe)

    The Stripe gateway class helper.

Usage

/**
 * Change the 'submit_type' argument to 'pay' instead of 'donate'.
 */
add_filter(
    'charitable_stripe_session_args',
    function( $args ) {
        if ( array_key_exists( 'submit_type', $args ) ) {
            $args['submit_type'] = 'pay';
        }
        return $args;
    }
);

charitable_stripe_payment_intent_args

Added in version 1.4.0

Filter the PaymentIntent arguments.

Return Value

An array of arguments which will be used in a \Stripe\PaymentIntent::create().

Arguments

  • $args (array)

    The PaymentIntent args.

  • $donation (Charitable_Donation)

    The donation object.

  • $processor (Charitable_Donation_Processor)

    The processor object.

  • $gateway (Charitable_Gateway_Stripe)

    The Stripe gateway class helper.

Usage

/**
 * Change the 'description' argument.
 */
add_filter(
    'charitable_stripe_payment_intent_args',
    function( $args, $donation ) {
        $args['description'] = 'My payment description';
        return $args;
    },
    10, 
    2
);

charitable_stripe_subscriptions_args

Added in version 1.4.0

Filter the arguments passed to Stripe to create a new Subscription.

Return Value

An array of arguments that are passed to a \Stripe\Subscription::create() call.

Arguments

  • $args (array)

    The subscription args.

  • $recurring (Charitable_Recurring_Donation)

    The recurring donation object.

  • $processor (Charitable_Stripe_Gateway_Processor)

    This gateway processor instance.

charitable_stripe_plan_args

Added in version 1.4.3

Filter the arguments passed to Stripe to make a new plan.

Return Value

An array of arguments that are passed to a \Stripe\Plan::create() call.

Arguments

  • $plan_args (array)

    The plan args to be sent to Stripe.

  • $plan (Charitable_Stripe_Plan)

    An instance of Charitable_Stripe_Plan object.

charitable_stripe_product_args

Added in version 1.4.3

Filter the arguments passed to Stripe to create a new product.

Return Value

An array of arguments that are passed to a \Stripe\Product::create() call.

Arguments

  • $product_args (array)

    The product arguments to be sent to Stripe.

  • $product (Charitable_Stripe_Product)

    An instance of Charitable_Stripe_Product.

charitable_stripe_product_statement_descriptor

Added in version 1.4.0

Filter the automatically formatted statement_descriptor for products.

Return Value

A string that will be used as the statement descriptor for a new Stripe Product object.

Arguments

  • $descriptor (string)

    The default descriptor.

  • $product (Charitable_Stripe_Product)

    The Charitable_Stripe_Product instance.

charitable_stripe_recurring_subscription_status

Added in version 1.2.0

Filter the status for a recurring subscription based on a Stripe status.

Return Value

String. A valid Charitable recurring donation status (one of charitable-pendingcharitable-activecharitable-onholdcharitable-cancelledcharitable-expiredcharitable-failedcharitable-cancel).

Arguments

  • $status (string)

    The Charitable status.

  • $stripe_status (string)

    Stripe’s status for the subscription. See Stripe’s list of possible statuses.

charitable_stripe_load_stripe_scripts_sitewide

Added in version 1.4.3

Whether to load the Stripe script site-wide.

Return Value

Boolean. Return true to load scripts site-wide (the default), or false to only load Stripe’s scripts on the donation form.

Arguments

  • $load (boolean)

    Whether to load the scripts site-wide. Defaults to true.

Usage

add_filter( 'charitable_stripe_load_stripe_scripts_sitewide', '__return_false' ); 

Action Hooks

charitable_stripe_ipn_event

Added in version 1.0.0

Fire an action hook to process the event.

Note that this will only fire for webhooks that have not already been processed by one of the default webhook handlers.

Return Value

Void

Arguments

  • $event_type (string)

    Type of event.

  • $event (\Stripe\Event)

    Stripe event object.

Still have questions? We’re here to help!

Last Modified:

What's New In Charitable

View The Latest Updates
🔔 Subscribe to get our latest updates
📧 Subscribe to Emails

Email Subscription

Join our Newsletter

We won’t spam you. We only send an email when we think it will genuinely help you. Unsubscribe at any time!

Campaigns New

🧡 Modal Donate Button: Turn Any Click into a Contribution

Instead of redirecting users to a new URL, the lightweight Modal Donation Button allows donors to complete their gift in a sleek, focused popup, keeping them engaged with your content while they support your cause.

What’s New:

  • Zero-Friction Giving: Open your donation form in a responsive modal overlay. Donors stay on the same page, reducing drop-off.

  • 🖱️ Place it Anywhere: Use the dedicated WordPress block or a simple shortcode to drop a donate button into sidebars, footers, or even mid-sentence in your storytelling.

  • 🎨 Full Design Control: Match your brand perfectly with customizable background colors, hover effects, border radius, and font sizes—all without touching a single line of CSS.

Whether you need a simple “Donate Now” link or a high-converting popup button, the Modal Donate Button gives you the flexibility to raise more with less effort.

donation form Donations New

💵 Mini Donation Widget: Show The Impact Of Every Dollar!

Not every donor who wants to give will navigate to your campaign page. Meet them exactly where they are by placing a fully functional giving experience directly on any page or post.

💬 Show the impact of every dollar: Attach custom messages to each preset amount so donors understand exactly what their gift provides.
🔄 Monthly and one-time giving: Supports a tabbed interface with independent amounts and impact statements for recurring giving programs.
🎨 Match your brand: Easily set accent colors and control size or alignment to fit the widget naturally into your layout without CSS.
⚡ Reduce donor friction: Open the donation form in a modal overlay to keep donors on the page and reduce drop-off.

Donations Live New

👉🏻 Showcase Real Momentum with the Donations Feed

Give your donors a reason to trust. Our new feed lets you display a living, breathing record of people showing up for your cause.

🤝 Build instant trust: Overcome donor hesitation by showing a proven track record of community support.
💬 Highlight donor stories: Display real donor comments and locations to show the human side of your fundraising.
🛠️ Drop it anywhere: Easily add the block to your homepage, campaign pages, or confirmation screens in seconds.
📈 Curate your feed: Group multiple donations from the same person or sort by highest amounts to encourage larger gifts.

Campaigns New

🎨 Campaign Showcase: Pro Level Display, No Coding Needed.

Display your causes with style and make it easier than ever for donors to find the right campaign. We are excited to announce the brand-new Campaign Showcase, a powerful, no-code tool designed to help you create beautiful, high-converting campaign grids and carousels.

The Ultimate Discovery Experience

Your mission deserves to be seen. With the Campaign Showcase, you can move beyond simple lists and create dynamic displays that highlight your most urgent needs, helping donors connect with the causes they care about most.

⚡ No-Code Customization: Effortlessly change layouts, columns, and styles with a single click. Whether you want a clean grid or an interactive carousel, you can match your organization’s look without any CSS or JavaScript.

🎯 Advanced Search & Filter: Empower your supporters with real-time filtering. Donors can quickly sort through campaigns by tags, popularity, or “ending soon,” making it easy to find exactly where their help is needed.

💰 Quick Donate Integration: Boost your conversions with instant giving. The Showcase allows donors to contribute via a modal popup directly from the display, featuring pre-selected amounts for a faster, friction-free experience.

Addon New

🤯 New Addon: Campaign Updates

Keep your supporters informed and engaged with every step of your progress! Share the ongoing impact of your mission and build lasting trust with your donor community!

The Ultimate Engagement Tool

Fundraising is a journey, not a one-time event. Now, you can easily provide real-time updates directly on your campaign pages, ensuring your donors stay connected to the causes they care about most.

📣 Easy Storytelling: Quickly post text updates, milestones, or field reports to show exactly how donations are being put to work, keeping the momentum alive throughout your fundraiser.

🏗️ Visual Builder Integration: Seamlessly add the Updates block anywhere on your page using our drag-and-drop builder, or use a simple shortcode to display news in widgets and sidebars.

📩 Build Donor Trust: By consistently sharing progress and success stories, you create a transparent giving experience that encourages recurring support and deeper community involvement.