• Resolved crackcodewithamal

    (@crackcodewithamal)


    Hi I need to capture payment manually for a product or a category of product. I have seen the common feature available for all product on admin capture option. but I need to allow for a product or a category of product .I have tried the following filter common to all product making capture option Capture charge immediately option enabled on admin . but does not worked.

    add_filter('wc_stripe_payment_intent_args', function($args, $order){
        $args['capture_method'] ='manual';
        return $args;
    
    },10, 2);

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @crackcodewithamal,

    That is the correct filter to use and your code looks fine. It sounds like you aren’t adding your filter in the right place.

    You will want to add some logic that checks the order for the product you want to manually capture the charge for.

    Kind Regards,

    Thread Starter crackcodewithamal

    (@crackcodewithamal)

    Hi I have checking on a dummy site with store front theme. I have been added the code on function.php but nothing happened.

    Plugin Author Payment Plugins

    (@mrclayton)

    @crackcodewithamal it’s not an issue with the Stripe plugin if your custom filter code isn’t being called.

    You will need to figure out why your custom code isn’t being called.

    For example, when I added your customer code to my theme it works fine.

    Thread Starter crackcodewithamal

    (@crackcodewithamal)

    Following filter worked .
    Thanks

    add_filter( 'wc_stripe_generate_payment_request', 'change_cap',2,3 );
    function change_cap( $post_data, $order, $prepared_source ) {
            $post_data['capture_method']='manual';
    }
    Plugin Author Payment Plugins

    (@mrclayton)

    @crackcodewithamal that’s a filter provided by the WooCommerce Stripe Payment Gateway plugin, not Stripe for WooCommerce. That explains why your use of my filter didn’t work. You’re using another Stripe plugin or you’re using 2 Stripe plugins at the same time.

    I don’t recommend you run two Stripe plugins at the same time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to change capture_method to manual for one product’ is closed to new replies.