mapdev\FacebookMessenger\Components\ReceiptSummary::toArray PHP Method

toArray() public method

public toArray ( )
    public function toArray()
    {
        $result = ['total_cost' => $this->total_cost];
        if (!is_null($this->subtotal)) {
            $result['subtotal'] = $this->subtotal;
        }
        if (!is_null($this->shipping_cost)) {
            $result['shipping_cost'] = $this->shipping_cost;
        }
        if (!is_null($this->total_tax)) {
            $result['total_tax'] = $this->total_tax;
        }
        return $result;
    }