• Resolved r00flr00fl

    (@r00flr00fl)


    Hello,

    I’d like to set the order status of orders paid with Stripe Credit/Debit Card to ‘on-hold’. What is the string of the payment method in this case? I have tried ‘stripe’ but it doesn’t seem to work. Thanks!

    add_filter( 'woocommerce_payment_complete_order_status', 'custom_payment_complete_status_payment_method', 10, 3 );
    function custom_payment_complete_status_payment_method( $status, $order_id, $order  ){
        $payment_method = $order->get_payment_method();
        if( $payment_method == 'stripe' ){
            $status = 'on-hold';
        }      
        return $status;     
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter r00flr00fl

    (@r00flr00fl)

    If there is a better solution please let me know. Still need help.

    Hello,

    The code you’ve shared above works on my test site. Orders paid with Stripe are automatically assigned to On-hold.

    Do you have any other custom codes that may be conflicting with this code? You can also try deactivating all plugins except WooCommerce and Stripe and switching theme to Storefront to check if that code works properly.

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Payment method string for credit card payments?’ is closed to new replies.