Magento:我如何获得特定订单的所有交易付款项目?
问题描述:
我如何获得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"
}
}
}
谢谢你们!
+0
我缺少toArray调用'var_dump(array('transactions'=> $ transactions-> toArray()));' –
答
$order->getPayment()->getMethodInstance()->getPaymentInfo();
会给你所有的支付信息
答
基于屏幕截图上的网格代码。适用于我:
$transactions = Mage::getResourceModel('sales/order_payment_transaction_collection');
$transactions->addOrderIdFilter($order->getId());
$transactions->addOrderInformation(array('increment_id'));
$transactions->addPaymentInformation(array('method'));
foreach ($transactions as $t) {
var_dump($t->debug());
}
抱歉误解。那么,你想要所有的交易付款项目,如信用卡信息? –