title: Get WooCommerce Order ID from Plugin
body: <p>I'm trying to create a payment gateway and I need to get the WooCommerce order ID. Problem is the notice I'm getting and to be fair, I am new to the world of WordPress and WooCommerce.</p>
  <p><strong>Notice</strong>: <code>Notice: ID was called incorrectly. Order properties should not be accessed directly.</code></p>
  <p>This is my code:</p>
  <pre><code>public function get_order_details( $post ) {
  if ( $post-&gt;post_type==&quot;shop_order&quot; ) : 
  $order = new WC_Order( $post );
  if ( $order ) :
  </code></pre>
  <p>I'm later, whenever needed, referencing it like this: <code>&lt;?php echo $order-&gt;get_id; ?&gt;</code></p>
  <p>I'm using the latest WP and WC versions. If anyone can point me in the right direction in terms of how to get the Order ID from my plugin, I would really appreciate it.</p>