33 lines
		
	
	
		
			908 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			908 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
| <?php
 | |
| 
 | |
| namespace IpSupply\SyncOrder\Sync;
 | |
| 
 | |
| class Order implements \JsonSerializable
 | |
| {
 | |
|     public $orderId = 0;
 | |
|     public $orderNumber = '';
 | |
|     public $statusPayment = null;
 | |
|     public $orderDate = null;
 | |
|     public $subTotal = null;
 | |
|     public $total = null;
 | |
|     public $shippingPrice = null;
 | |
|     public $currency = null;
 | |
| 
 | |
|     function __construct(\Magento\Sales\Model\Order $order)
 | |
|     {
 | |
|         $this->orderId = $order->getId();
 | |
|         $this->orderNumber = $order->getRealOrderId();
 | |
|         $this->statusPayment = $order->getStatus();
 | |
|         $this->orderDate = $order->getUpdatedAt();
 | |
|         $this->subTotal = $order->getSubtotal();
 | |
|         $this->total = $order->getGrandTotal();
 | |
|         $this->shippingPrice = $order->getShippingAmount();
 | |
|         $this->currency = $order->getOrderCurrencyCode();
 | |
|     }
 | |
| 
 | |
|     public function jsonSerialize(): mixed
 | |
|     {
 | |
|         return get_object_vars($this);
 | |
|     }
 | |
| }
 |