Open
Description
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 underlyingwc_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!