Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: How have I to get all the transaction payment items of a specific order?

Tags:

php

magento

How have I to get all the transaction payment items of a specific order in Magento?

I can get the last Transaction Id only:

$transId = $order->getPayment()->getLastTransId();

is there a way to get all the order transaction?

This is the information that I need

thanks

like image 696
Michelangelo Avatar asked Dec 13 '25 17:12

Michelangelo


1 Answers

Finally I have solved the problem!

I have solved in this way!

$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
                                                                         ->addAttributeToFilter('order_id', array('eq' => $payment->getOrder()->getEntityId()))
                                                                         ->addAttributeToFilter('txn_type', array('eq' => 'capture'));

this is the result:

array(2) {
  ["totalRecords"] => int(1)
  ["items"] => array(1) {
    [0] => array(10) {
      ["transaction_id"] => string(2) "62"
      ["parent_id"] => NULL
      ["order_id"] => string(2) "89"
      ["payment_id"] => string(2) "89"
      ["txn_id"] => string(16) "3060630120986423"
      ["parent_txn_id"] => NULL
      ["txn_type"] => string(7) "capture"
      ["is_closed"] => string(1) "1"
      ["additional_information"] => array(0) {
      }
      ["created_at"] => string(19) "2013-08-19 09:36:07"
    }
  }
}

Thanks Guys!

like image 108
Michelangelo Avatar answered Dec 15 '25 10:12

Michelangelo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!