diff --git a/src/Models/OrderLine.php b/src/Models/OrderLine.php index 3cdd454..07f907b 100644 --- a/src/Models/OrderLine.php +++ b/src/Models/OrderLine.php @@ -4,38 +4,38 @@ class OrderLine { - const TYPE_PHYSICAL = 'physical'; - const TYPE_DISCOUNT = 'discount'; - const TYPE_SHIPPING_FEE = 'shipping_fee'; - const TYPE_SALES_TAX = 'sales_tax'; - const TYPE_DIGITAL = 'digital'; - const TYPE_GIFT_CARD = 'gift_card'; - const TYPE_STORE_CREDIT = 'store_credit'; - const TYPE_SURCHARGE = 'surcharge'; + public const TYPE_PHYSICAL = 'physical'; + public const TYPE_DISCOUNT = 'discount'; + public const TYPE_SHIPPING_FEE = 'shipping_fee'; + public const TYPE_SALES_TAX = 'sales_tax'; + public const TYPE_DIGITAL = 'digital'; + public const TYPE_GIFT_CARD = 'gift_card'; + public const TYPE_STORE_CREDIT = 'store_credit'; + public const TYPE_SURCHARGE = 'surcharge'; - public string $type; - public string $reference; - public string $name; - public int $quantity; - public int $unit_price; - public int $tax_rate; - public int $total_amount; - public int $total_discount_amount; - public ?int $total_tax_amount = null; - public string $merchant_data; - public ?string $product_url = null; - public ?string $image_url = null; + public $type; + public $reference; + public $name; + public $quantity; + public $unit_price; + public $tax_rate; + public $total_amount; + public $total_discount_amount; + public $total_tax_amount; + public $merchant_data; + public $product_url; + public $image_url; - public function __construct(array $data) + public function __construct(array $orderLine) { - foreach ($data as $prop => $value) { + foreach ($orderLine as $prop => $value) { if (property_exists($this, $prop)) { $this->$prop = $value; } } } - public function toArray() + public function toArray(): array { return [ 'type' => $this->type, @@ -52,4 +52,4 @@ public function toArray() 'image_url' => $this->image_url, ]; } -} \ No newline at end of file +}