Skip to content

New (src) Order Service: Prevent direct usage of WP_Order  #7367

Open
@RadoslavGeorgiev

Description

@RadoslavGeorgiev

This issue is an extension of this discussion: #7333 (comment) and a follow-up to #7333.

Quoting @marcinbot:

Probably with our own wrapper for order data. We could even try to do something clever with __call magic method that will allow to access only getters on the underlying wc_order, but not the setters or the save method (or preferably declare the getters manually).
The better abstraction from Woo Core we achieve here, the more confident we can be that the future devs will follow our patterns.

Essentially, we need to either add all necessary getters and setters to WCPay\Internal\Service\OrderService, create a new class for orders, specific to WooPayments, or something in the middle.

All comments and suggestions are welcome!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions