WooCommerce Extension - Capture Payment Step

The Capture Payment step will collect a payment that was authorized during the WooCommerce Checkout. If there is a Capture Payment step in the workflow then the payment will be collected when the Capture Payment step runs. Remember that payment gateways automatically cancel (expires) payments after certain days if the payment is not captured (Stripe cancels them after 7 days and PayPal does the same after 29 days). So your workflow must ensure that the Cancel Payment step runs within this duration of the initial form submission.

Capture Payment Step Settings

Next Step if Captured: Select the next step in the workflow if the payment was captured successfully. For example, you could select a notification step and send emails to the customer and an administrator informing them that the payment was captured successfully.

Next Step if Failed: Select the next step in the workflow if the payment was not captured successfully. The most likely scenario for this is that the 7-day limit was exceeded (take Stripe for instance) and the payment authorization was canceled. The step can also fail if the WooCommerce order status isn’t “on-hold” or it fails to be updated to “processing”. For example, you could select a notification step and send emails to the customer and an administrator informing them that the payment was not captured successfully.

Capture payments in statuses other than "On-Hold" (Added sinceCapture payment 1.5)

If you want to support payment statuses other than on-hold, use the following filter:

function my_gravityflowwoocommerce_valid_payment_statuses( $statuses, $step ) {
	if ( $step === 'woocommerce_capture_payment' ) {
		$statuses[] = 'pending'; // Add the new status you'd like to capture the payment from.
	}
	
	return $statuses;
}
add_filter( 'gravityflowwoocommerce_valid_payment_statuses', 'my_gravityflowwoocommerce_valid_payment_statuses', 10, 2 );

Change payment status to Completed after capture the payment (Added since 1.5)

By default, we set the payment status to "Processing" after capturing it. You can change it to "Completed" if that's what you need.

function my_gravityflowwoocommerce_paid_payment_status( $status, $step ) {
	if ( $step === 'woocommerce_capture_payment' ) {
		return 'completed'; // Change to completed, the default is processing.
	}
	
	return $status;
}
add_filter( 'gravityflowwoocommerce_paid_payment_status', 'my_gravityflowwoocommerce_paid_payment_status', 10, 2 );