微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – Magento:我如何获得特定订单的所有交易付款项目?

我如何获得Magento中特定订单的所有交易付款项目?

我只能得到最后一个交易ID:

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

有没有办法获得所有订单交易?

谢谢

解决方法:

最后我解决了这个问题!

我已经用这种方式解决了!

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

这是结果:

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"
    }
  }
}

多谢你们!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐