30 lines
		
	
	
		
			820 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			820 B
		
	
	
	
		
			PHP
		
	
	
	
| <?php
 | |
| namespace IpSupply\SyncOrder\Sync;
 | |
| 
 | |
| class Order implements \JsonSerializable
 | |
| {
 | |
|     public $orderId = 0;
 | |
|     public $statusPayment = '';
 | |
|     public $orderDate = '';
 | |
|     public $subTotal = '';
 | |
|     public $total = '';
 | |
|     public $shippingPrice = '';
 | |
|     public $currency = '';
 | |
| 
 | |
|     function __construct(\Magento\Sales\Model\Order\Interceptor $order)
 | |
|     {
 | |
|         $this->orderId = $order->getId();
 | |
|         $this->statusPayment = $order->getStatus();
 | |
|         $this->orderDate = $order->getUpdatedAt();
 | |
|         $this->subTotal = $order->getSubtotal();
 | |
|         $this->total = $order->getTotalInvoiced();
 | |
|         $this->shippingPrice = $order->getShippingInvoiced();
 | |
|         $this->currency = $order->getOrderCurrencyCode();
 | |
|     }
 | |
| 
 | |
|     public function jsonSerialize()
 | |
|     {
 | |
|         return get_object_vars($this);
 | |
|     }
 | |
| }
 |