如何获取 Magento 上的付款信息?
我必须将订单导出到文件,这是我的代码来浏览订单:
$orders = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect(array('status', 'ncm'))
->addFieldToFilter(
array(
array('attribute' => 'status', 'eq' => 'complete')
)
);
$order = $orders->getFirstItem();
//print_r($order);
//exit;
//foreach($orders as $order){
$id = $order->getIncrementId();
$payment = $order->getPayment();
$method = $payment->getMethodInstance();
print_r($payment);
//}
我需要打印一些有关付款的信息 比如方法,金额,分割了多少个月,如果是信用卡,我需要交易的 reutrning id 等等,
我该怎么做?
I have to export the orders to a file, here is my code to go through the orders:
$orders = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect(array('status', 'ncm'))
->addFieldToFilter(
array(
array('attribute' => 'status', 'eq' => 'complete')
)
);
$order = $orders->getFirstItem();
//print_r($order);
//exit;
//foreach($orders as $order){
$id = $order->getIncrementId();
$payment = $order->getPayment();
$method = $payment->getMethodInstance();
print_r($payment);
//}
I need to print some information about the payment
like the method, the amount, how many months it was split, if was credit card, i need the reutrning id of the transaction and so the list goes on
how can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为它将
检索当前订单支付实例。
I think it will be
It will retrieve the current order payment instance.
要仅获取方法代码,使用 Skipping 实例对象要安全得多,
如果卸载支付方法,该对象可能会生成异常。
To get the method code only it's far safer to use
Skipping instance object which can generate exception if the payment method was uninstalled.