In my Magento 1.9 installation I have an observer that observes the event sales_order_invoice_pay
. When this event triggers I'm attempting to store the invoice's ID in a custom model I've created.
Here's how I'm getting the invoice from the event: $invoice = $observer->getEvent()->getInvoice();
However, when I attempt this using: getId()
, getData('entity_id')
, getIncrementId()
, or getOrigData('entity_id')
, I receive a null
value.
I can't even seem to get the increment id from the invoice either, I've used, getIncrementId()
, getData('increment_id')
.
I'm at a complete loss here.
It's important for me to store this specific invoice id as I'm using it later to load that invoice and create a shipment for items invoiced.
Is there anyway for me to get the ID?