Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there @davidr2021,

    > I liked to add the product name to the Description that is passed on to Stripe

    Thanks for the message. My assumption is that you’re referencing the Statement Descriptor field. If so, at the moment this isn’t a possibility built into our Stripe plugin. There’s the high possibility that customers could order more than one product or the product name could be generic, thus the statement descriptor field would normally use the business name as a common practice. This helps customers know what business charged their card.

    Also, with Stripe this descriptor is limited to 22 characters. I imagine in most scenarios the business name and product name would exceed this limit.

    I’m not sure if there is a future case where this could be possible, but we’d always welcome this added to our ideas board. –> https://ideas.woocommerce.com/forums/133476-woocommerce

    Thread Starter davidr2021

    (@davidr2021)

    I mean the DESCRIPTION field on the payment page

    View post on imgur.com

    There is no limit to the number of characters

    • This reply was modified 3 years, 4 months ago by davidr2021.
    Thread Starter davidr2021

    (@davidr2021)

    There is no limit to the number of characters

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @davidr2021,

    Sorry for misunderstanding, but thanks for clarifying.

    I don’t believe there is any existing method, like a hook or filter, to modify this. But ultimately it could likely be done with a good chunk of custom work. If you wanted to go down that route, we highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)

    Thread Starter davidr2021

    (@davidr2021)

    I guess that’s a requirement of a lot of people
    Is there a code that someone has already written that you can refer us to?

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @davidr2021,

    I found that the data comes from the /includes/abstracts/abstract-wc-stripe-payment-gateway.php file in the Stripe payment method.

    From there I did find a wc_stripe_generate_payment_request filter that you might be able to use. There is some examples of that here. https://www.ads-software.com/support/topic/modify-the-payment-description/

    Thread Starter davidr2021

    (@davidr2021)

    Thanks I’ll check it out

    Thread Starter davidr2021

    (@davidr2021)

    I need to replace the code with existing code or add the code to the page and if so where to add it.

    add_filter( 'wc_stripe_generate_payment_request', 'filter_wc_stripe_payment_descriptionmod', 3, 10 );
    function filter_wc_stripe_payment_descriptionmod( $post_data, $order, $source ) {
    	foreach( $order->get_items() as $item_id => $line_item ){
    		$item_data = $line_item->get_data();
    		$product = $line_item->get_product();
    		$product_sku = $product->get_sku();
    	}
    	$post_data['description'] = sprintf( __( '%1$s | %2$s' ), $product_sku, $post_data['description'] );
    	return $post_data;
    }

    Whatever code snippet you end up using can be placed in your child theme’s functions.php file.
    I’m not able to assist with actually writing/changing any of the code in that snippet, but you can always reach out to a private developer if needed: https://woocommerce.com/customizations/

    Thread Starter davidr2021

    (@davidr2021)

    Thanks!!!!

    Plugin Support Saravanan S, a11n

    (@simplysaru)

    @davidr2021,

    Thanks. We will mark this issue resolved.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Description that is passed on to Stripe’ is closed to new replies.