• Resolved 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 6 replies - 1 through 6 (of 6 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.

    Thread Starter JS

    (@damndealdone)

    I will submit it as a feature request.

    The previous code does not work.

    // Creates a 24 hour grace period before funds are captured from a customer's bank account.

    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 WooCommerce is set to "Issue an authorization and capture later"
    if ( isset( $args['capture_method'] ) && $args['capture_method'] === 'manual' ) {

    // Ensure the card options array structure exists
    if ( ! isset( $args['payment_method_options'] ) ) {
    $args['payment_method_options'] = array();
    }
    if ( ! isset( $args['payment_method_options']['card'] ) ) {
    $args['payment_method_options']['card'] = array();
    }

    // Keep root capture_method as manual so WooCommerce treats it as an authorized hold
    // But instruct Stripe's card handler to automatically capture it later
    $args['payment_method_options']['card']['capture_method'] = 'automatic_delayed';
    $args['payment_method_options']['card']['capture_delay_days'] = 1; // 24 hours
    }
    return $args;
    }

    Trying this now.

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi @damndealdone

    Thank you for the update.

    I can understand that the code shared by the AI did not work as expected.

    If you’re looking for a custom solution to implement this functionality, you may want to consult with a developer, as custom code and custom Stripe integrations fall outside our usual scope of support.

    You can also ask your development questions in the  WooCommerce Community Slack.

    In the meantime, submitting this as a feature request is a good approach, as it allows the team to consider adding support for this functionality in a future release.

    Plugin Support Kay U a11n

    (@kingsleyinfo)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    Thread Starter JS

    (@damndealdone)

    Why not allow people to use this forum as forums are intended? If someone crosses this thread and they have a solution, they might want to offer it. What purpose is there to closing it and preventing this possibility? It is clearly not resolved. Maybe don’t call this a forum. I don’t think I will be back, regardless.

    Frank Remmy

    (@frankremmy)

    Hi @damndealdone,

    Thanks for sharing your thoughts, and I completely understand your frustration here.

    You’re right that the feature itself hasn’t been implemented or solved. Marking the thread as resolved doesn’t mean the request was completed or dismissed. It mainly helps keep the support forum organized by removing inactive threads from the New/Open queue.

    The thread remains publicly available, so anyone searching the forum or finding it through Google can still read the discussion and benefit from the context shared here.

    For clarity, the Stripe extension currently does not include a built-in setting for automatic delayed capture, and we’re not able to verify or support custom code snippets here. The best place to track demand for this as a product feature is still the Stripe feature request board:

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

    Other community members are welcome to share general suggestions here, but any custom implementation should be tested carefully with a developer before being used on a live store.

    Thanks again for the feedback.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.