Filter uncanny-automator

automator_stripe_create_payment_link_multiselect_fields

Filters the multiselect fields used when creating a Stripe payment link to allow modification before it's generated.

add_filter( 'automator_stripe_create_payment_link_multiselect_fields', $callback, 10, 1 );

Description

Filters the default multiselect fields used when creating a Stripe payment link. Developers can add or remove fields from the `$fields` array, enabling custom options for payment methods, shipping country collections, or invoice tax IDs. This hook fires before the payment link is created.


Usage

add_filter( 'automator_stripe_create_payment_link_multiselect_fields', 'your_function_name', 10, 1 );

Parameters

$fields (mixed)
This parameter contains an array of Stripe payment link fields that are designed to support multiple selections, allowing users to choose more than one option for certain settings.

Return Value

The filtered value.


Examples

add_filter(
	'automator_stripe_create_payment_link_multiselect_fields',
	function( $fields ) {
		// Add custom Stripe fields to be treated as multi-select in the payment link creation form.
		// For example, if you want to allow users to select multiple shipping countries.
		// Note: This is illustrative; actual Stripe API field names and capabilities should be verified.
		$fields[] = 'shipping_options.shipping_address';

		return $fields;
	},
	10, // Priority
	1  // Accepted args
);

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/integrations/stripe/actions/create-payment-link.php:321

public function multiselect_fields() {

		$fields = array(
			'payment_method_types',
			'shipping_address_collection.allowed_countries',
			'invoice_creation.invoice_data.account_tax_ids',
		);

		return apply_filters( 'automator_stripe_create_payment_link_multiselect_fields', $fields );
	}

Scroll to Top