Trigger a notification message from the on_before_save hook within a custom module's model.
I'm working on an Authorize.net integration within a module I have called "Refunds". The goal is to store refund information for refund transactions, and in addition to storing the information in a Fuel model, I want it to actually process the refund in Authorize.net. I also want to display notifications in the notifications bar of Fuel to let the user know if the refund transaction was successful or not. You can imagine that it makes sense that the Authorize.net transaction needs to be handled before the Refund is saved to the database, hence the use of the on_before_save hook.
How do I tap into that area in order to setup my own custom messages, in addition to the "Data has been saved." message that flashes in green? I would like a notification to display in red when the transaction fails to process, and green otherwise.
Thanks,
Erik
Comments