Skip to content

Refactor needed for methods check_payment_intent_attached_to_order_succeeded and check_against_session_processing_order #6712

Open

Description

Description

Currently the check_payment_intent_attached_to_order_succeeded and check_against_session_processing_order of class Duplicate_Payment_Prevention_Service
return both an array or void|null, which does not line up with the expected results of the method name. The methods also perform other side actions while checking, such as removing the order from the current session and updating the order based on the intent status.

Relevant lines:

public function check_against_session_processing_order( WC_Order $current_order ) {

public function check_payment_intent_attached_to_order_succeeded( WC_Order $order ) {

Acceptance criteria

  • If the method is checking for something, it should return a bool value. The calling code should then be able to progress with that value.
  • The side actions should be removed and should be handled in the progression of the calling code.

Additional context

This was brought up in the discussion here: p1688627901421529-slack-CGGCLBN58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    category: coreWC Payments core related issues, where it’s obvious.category: refactorThe issue/PR is related to refactoring.focus: payments acceptance & processinggood first issueThe issue is a good candidate for the first community contribution/for a newcomer to the team.priority: lowThe issue/PR is low priority—not many people are affected or there’s a workaround, etc.type: technical debtThis issue/PR represents/solves the technical debt of the project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions