Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Attempting to pay with a non-available payment method doesn't throw an error. #5405

Closed
senadir opened this issue Dec 16, 2021 · 0 comments · Fixed by #5440
Closed

Attempting to pay with a non-available payment method doesn't throw an error. #5405

senadir opened this issue Dec 16, 2021 · 0 comments · Fixed by #5440
Assignees
Labels
type: bug The issue/PR concerns a confirmed bug.

Comments

@senadir
Copy link
Member

senadir commented Dec 16, 2021

Related to #5404, when attempting to pay with a payment method that is not available, you don't get an error, the order isn't placed, but is set to pending payment.

Payments can be registered but not available, using a code like this:

add_filter( 'woocommerce_available_payment_gateways', function( $methods ) {
	unset( $methods['cod'] );
	return $methods;
} );

This was protected using get_request_payment_method, but in a recent refactor, that function is no longer called.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
2 participants