I know that I can use order->getPayment()->getLastTransId() to get the related transaction id from the most recently processed transaction, but it's not as specific as I'd like.

Is there a method to get the specific transaction id associated with an invoice?

Example: Place Order -> Original Authoriztaion ID xxx1 Partial Invoice A -> Delayed Capture Transaction ID xxx2 Partial Invoice B -> Delayed Capture Transaction ID xxx3 Final Invoice C -> Delayed Capture Transaction ID xxx4

How would I get the transaction ID that is specifically related to Invoice A?


Not sure if I understand your question but try

if ($order->hasInvoices()) {
      $oInvoiceCollection = $order->getInvoiceCollection();
      foreach ($oInvoiceCollection as $oInvoice) {
          $transaction_id  = $oInvoice->getTransactionId();
          // ...

if you know the invoice id

$oInvoice = Mage::getModel("sales/order_invoice")->load($id);
$transaction_id  = $oInvoice->getTransactionId();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.