Fix available gateways in order-pay page

This commit is contained in:
Pedro Silva 2024-02-02 13:53:12 +00:00
parent 6e78c875c2
commit fba6089db0
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 4 additions and 2 deletions

View file

@ -346,9 +346,10 @@ class SettingsListener {
/**
* Prevent enabling both Pay Later messaging and PayPal vaulting
*
* @return void
* @throws RuntimeException When API request fails.
*/
public function listen_for_vaulting_enabled() {
public function listen_for_vaulting_enabled(): void {
if ( ! $this->is_valid_site_request() || State::STATE_ONBOARDED !== $this->state->current_state() ) {
return;
}

View file

@ -168,7 +168,8 @@ class WcSubscriptionsModule implements ModuleInterface {
return $methods;
}
if ( ! is_wc_endpoint_url( 'order-pay' ) ) {
//phpcs:disable WordPress.Security.NonceVerification.Recommended
if ( ! ( isset( $_GET['change_payment_method'] ) && is_wc_endpoint_url( 'order-pay' ) ) ) {
return $methods;
}