Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sumonst21/88c7c760e8506113f819e93895b1f867 to your computer and use it in GitHub Desktop.
Save sumonst21/88c7c760e8506113f819e93895b1f867 to your computer and use it in GitHub Desktop.
WooCommerce Authorize.net CIM: Adjust authorize-only transaction order status
<?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