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

Clicking the toggle on Settings > Payments results in a (possibly unnecessary) redirect #190

Closed
jorgeatorres opened this issue Jul 5, 2021 · 0 comments · Fixed by #206
Closed
Labels
bug Something isn't working

Comments

@jorgeatorres
Copy link
Member

Describe the bug

Context: The enable/disable toggle that appears on WC > Settings > Payments either automatically enables/disables a gateway or redirects to the gateway settings screen if said gateway "needs setup" (controlled by WC_Payment_Gateway::needs_setup()).

In PayPal Payments this method always returns true, which results in a redirect that could be skipped when all the API details have already been filled out and the merchant just wants to quickly enable/disable the gateway.

To reproduce

  1. Complete onboarding or fill out all the relevant API details.
  2. Go to WooCommerce > Settings > Payments.
  3. Scroll down to "PayPal" and make sure the toggle is in the disabled state.
  4. Click the toggle.
  5. Confirm that instead of the gateway being enabled, you are redirected to the settings screen.

Screenshots

Screencast showing a redirect takes place when trying to enable the gateway via the toggle, even when the gateway is correctly configured:

screencast1

Expected behavior

needs_setup() should accurately reflect the gateway situation. If API credentials have been stored, needs_setup() should return false.

@jorgeatorres jorgeatorres added the bug Something isn't working label Jul 5, 2021
@jorgeatorres jorgeatorres changed the title Clicking the toggle on Settings > Payments results in a (sometimes unnecessary) redirect Clicking the toggle on Settings > Payments results in a (possibly unnecessary) redirect Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant