woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

Honor “shape” setting when rendering standalone buttons #844

Closed jorgeatorres closed 3 years ago

jorgeatorres commented 3 years ago

Issue: #806


Description

When rendering buttons in standalone mode (for instance, when some methods are hidden in certain contexts but not in others) the configured button shape is only applied to the main PayPal button and not the other buttons (such as Debit/Credit card or Pay Later). This PR fixes this problem by making sure all buttons are rendered using the same shape.

Steps to test:

  1. For master, follow these steps to confirm the bug (adapted from #806):
    1. Go to: WooCommerce > Settings > Payments > 'PayPal Checkout' > "Button Settings"
    2. Set Button Shape to: Pill
    3. Ensure that Credit or Debit Card is not a hidden funding method: https://d.pr/i/C6LlNY
    4. Ensure that at least one method is hidden to force standalone rendering.
    5. Navigate to checkout to see that the 'PayPal' button is Pill, while 'Credit or Debit Card' is Rectangle: https://d.pr/i/CpSgGF
  2. On this branch (issue-806) all buttons should have the same shape.
    1. Test standalone rendering by ensuring at least one method is hidden.
    2. Test default rendering by ensuring no method is hidden (and PayPal Credit is not disabled).

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

Honor “shape” setting when rendering standalone buttons.

Closes #806.

james-allan commented 3 years ago

LGTM 👍