Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WooPay enabled during NOX onboarding despite being disabled in recommended payment methods #10441

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/fix-10440-woopay-capability-disable
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix WooPay enabled during NOX onboarding despite being disabled in recommended payment methods.
11 changes: 7 additions & 4 deletions includes/class-wc-payments-onboarding-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,17 @@ public function update_enabled_payment_methods_ids( $gateway, $capabilities = []
}
}

// If WooPay is enabled, update the gateway option.
// Update gateway option with the WooPay capability.
if ( ! empty( $capabilities['woopay'] ) ) {
$gateway->update_is_woopay_enabled( true );
} else {
$gateway->update_is_woopay_enabled( false );
}

// If Apple Pay and Google Pay are disabled update the gateway option,
// otherwise they are enabled by default.
if ( empty( $capabilities['apple_google'] ) ) {
// Update gateway option with the Apple/Google Pay capability.
if ( ! empty( $capabilities['apple_google'] ) ) {
$gateway->update_option( 'payment_request', 'yes' );
} else {
$gateway->update_option( 'payment_request', 'no' );
}
}
Expand Down
Loading