Forked from maxrice/wc-auth-net-cim-adjust-auth-only-order-status.php
Created
March 15, 2022 21:59
-
-
Save sumonst21/88c7c760e8506113f819e93895b1f867 to your computer and use it in GitHub Desktop.
WooCommerce Authorize.net CIM: Adjust authorize-only transaction order status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sv_wc_auth_net_cim_tweak_held_order_status( $order_status, $order, $response ) { | |
if ( 'on-hold' === $order_status && $response instanceof SV_WC_Payment_Gateway_API_Response && $response->transaction_approved() ) { | |
$order_status = 'processing'; | |
} | |
return $order_status; | |
} | |
add_filter( 'wc_payment_gateway_authorize_net_cim_credit_card_held_order_status', 'sv_wc_auth_net_cim_tweak_held_order_status', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment