Allow for easily sending multiple order items

This allows for the sending of multiple items in a single order, by
adding a new `OrderItem` class and moving all of the order item specific
fields from the `Order` to an individual item.

These can then be assigned to an order using the `withOrderItems()`
method as an array of order items.

Fixes #19
This commit is contained in:
Oliver Davies 2020-06-08 19:33:49 +01:00
parent 0ed99797f5
commit ae766763b2
9 changed files with 86 additions and 53 deletions

View file

@ -19,16 +19,12 @@ class OrderTest extends TestCase
$order = new Order(
$customer,
'this-is-the-sku',
'123',
'GBP',
10.00
'GBP'
);
$this->assertSame('GBP', $order->getCurrencyCode());
$this->assertSame($customer, $order->getCustomer());
$this->assertSame('123', $order->getOrderNumber());
$this->assertSame(10.0, $order->getPrice());
$this->assertSame('this-is-the-sku', $order->getSku());
}
}