Pass custom Checkout field value to Stripe gateway in WooCommerce

You can use wc_stripe_payment_metadata dedicated filter hook to add (pass) some custom meta data to Stripe gateway, this way:

add_filter( 'wc_stripe_payment_metadata', 'stripe_payment_metadata_filter_callback', 10, 3 );
function stripe_payment_metadata_filter_callback( $metadata, $order, $prepared_source ) {
    // Here below define your custom field meta key (as it's saved in wp_postmeta DB table)
    $metadata="custom_meta_key";

    $metadata[ __( 'Custom Label Text (or meta key)', 'woocommerce-gateway-stripe' ) ] = $order->get_meta($meta_key);

    return $metadata;
}

Code goes in functions.php file of your active child theme (or active theme). It should work.


Related threads: