Refactor payment method buttons and separators rendering #5472
Labels
category: projects
For any issues which are part of any project, including bugs, enhancements, etc.
category: refactor
The issue/PR is related to refactoring.
component: checkout
Issues related to Checkout
type: technical debt
This issue/PR represents/solves the technical debt of the project.
Why is the refactoring needed?
There was a fix implemented here and here that resolves the issue of displaying multiple separators on the checkout, cart, product details pages.
After the fix, the button and separator displaying implementations are separated from each other. With that, a few drawbacks are currently visible, and these should be resolved once the refactoring is completed:
WC_Payments::display_express_checkout_separator_if_necessary
for the separator andWC_Payments_*_Button_Handler::init
forPlatform_Checkout
,Payment_Request
andStripe_Link
accordingly. This will lead to situations when e.g. the WooPay button logic is changed in the future, we might easily forget to update the logic in the separator rendering class, which will immediately result in displaying the separator alone when the button is disabled.class-wc-payments.php
, which doesn't seem to be its direct responsibility.class-wc-payments.php
class.Ideally, we could create a new class that will merge and orchestrate all the logic from both button and separator rendering in one place and test it out properly.
Acceptance criteria
The text was updated successfully, but these errors were encountered: