Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Payment
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2016 at 16:32 UTC
Updated:
29 Jun 2016 at 17:44 UTC
Jump to comment: Most recent
We will soon have pricing and payment APIs that require price values as arguments.
The problem with the object used for entity fields is that it can't be instantiated standalone, which means people can't pass their own amounts without creating an entity first, and then using that entity's field item. That's clunky. Instead, let's introduce a value object for this purpose.
Plan:
- Rename Price to PriceItem (matches core conventions)
- Add a Price value object (no interface, getDecimalAmount, getCurrencyCode)
- Add PriceItem::toPrice(), and allow setValue() to accept the price.
Comments
Comment #3
bojanz commentedDone.