Support » Plugin: Payment Plugins for Stripe WooCommerce » Authorise & Capture

  • Resolved shiv99

    (@shiv99)


    Is there a possibility to authorize a card, and then capture payment further in the future than the usual 7 days. Scenario: hotel owning client wants customer’s cc details to confirm room booking but not capture payment until day before arrival (which could be months later). TIA

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

    (@mrclayton)

    Hi @shiv99,

    Stripe won’t allow an authorization to live beyond the 7 day maximum so your best option is to save the payment method during the checkout process. With the payment method saved you can charge it at a later date beyond the 7 days. Here is an example of what custom code to add:

    add_filter('wc_stripe_force_save_payment_method', function($bool, $order){
        // add whatever custom logic you need to determine if payment method should be 
        //saved.
        return true;
    }, 10, 2);

    You would need to ensure your customers are logged in so Stripe has a user to associate with the saved payment method. I recommend disabling guest checkout in the WooCommerce Account Settings if you go with this option.

    Kind Regards,

    Thread Starter shiv99

    (@shiv99)

    Many thanks for your help.

    I’m not really that experienced with regards to the custom code. Could you please give me an idea where to place it and what kind of //add whatever custom logic you need to determine if payment method should be saved. // I need? Would it be possible that you provide me with this as well?

    Also, how/where is the token for the payment saved during the time from authorization to the final capture?

    Many thanks in advance!

    Siobhán

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @shiv99,

    You can place that code in your child theme’s functions.php. I recommend you read a few articles on adding code snippets as it will be helpful to know in the future.

    I don’t know what custom logic you need since I don’t know your business model. Perhaps you want to save all payment methods and if so then just use what I provided.

    The token is saved in Stripe and your WooCommerce payment method tables.

    Kind regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Authorise & Capture’ is closed to new replies.