• JS

    (@damndealdone)


    Hello.

    I understand that there are no settings for creating an automatic delayed capture in the plug-in. I think this would be a good feature to implement. Including a way to select how many days after authorisation to capture, or automatic capture 6 hours before cancellation which I believe is the Stripe default. This would allow customers a small grace period to change their mind and not end up costing the shop any fees.

    If this is not possible, I would like to implement this through some other means.

    Google AI suggest this code in functions.php, after setting the Stripe plug-in to manual capture.

    add_filter( 'woocommerce_stripe_payment_intent_args', 'force_stripe_24h_delayed_capture', 10, 2 );
    function force_stripe_24h_delayed_capture( $args, $order ) {
    // Only apply if the WooCommerce plugin is set to capture later
    if ( isset( $args['capture_method'] ) && $args['capture_method'] === 'manual' ) {
    $args['capture_method'] = 'automatic_delayed';

    // Tells Stripe to automatically capture 1 day (24 hours) after authorization
    $args['payment_method_options']['card']['capture_delay_days'] = 1;
    }
    return $args;
    }

    Are there any experts on hand to verify this as a good solution?

    Many thanks

    JS

Viewing 1 replies (of 1 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thanks for sharing your use case. I can see how having an automatic delayed capture option would be useful, especially for stores that want to offer a grace period before funds are captured.

    As for the code snippet suggested by Google AI, custom code falls outside the scope of support we can provide here, so we’re unable to verify whether it is a safe or reliable solution for production use.

    Since this functionality is not currently available in the plugin, I’d recommend submitting it as a feature request here:

    https://woocommerce.com/feature-requests/stripe/

    That allows the product team to review the use case and gauge interest from other merchants. If others would benefit from this functionality as well, they can vote on the request to help increase its visibility.

    If you need more in-depth support or want to consider professional assistance for customization, I can recommend WooExperts and Codeable.io as options for getting professional help.

    Alternatively, you can also ask your development questions in the  WooCommerce Community Slack as custom code falls outside our usual scope of support.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.