cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice and Capture

Invoice and Capture

Hi to all!

I am trying to understand how Invoice creation and Capture works and would like to ask few questions.

I am working on custom payment module with following settings

 

protected $_canCapture = true;

protected $_canCapturePartial = true;

 

After the Order is created it is with Auth status and wait for Settle. So I go to Order Invoice menu and create Online Invoice.

I have two observers for the Invoice - Register and AfterSave. In Register I set the Invoice status to be Open. In AfterSave I do the real Online Settle process and get some response. My problem is when I got Decline Response. After the invoice is saved I have Capture Transaction and Invoice (Pending or Paid, depends of status I set into Register Observer)

And the question - can I go throw Invoice logic but stop Magento doing Capture and Invoice, I can try make them when get the response from the Online process?

At the moment I tried to delete the Transaction and the Invoice after Decline. I did it, but the Invoice menu is not visible anymore, looks like its visibility depends not only form the deleted Transaction and Invoice. If this approach is not wrong, what else I need to do so I can get Invoice menu back, so I can try Settle again?

 

Thanks and Regards!