作为一个额外的欺诈控制,我想根据客户下订单后的某些订单详情设置不同的订单状态。
类似的东西:
if($order->getPayment()->getTransaction()->getAdditionalInformation('avszip') != Y)
$order->setState('review for fraud');
else
$order->setState('processing');
我会在哪里这样做?我假设我会在
中拦截一些默认的setState代码行app/code/core/Mage/Sales/Model/Order/Payment.php
答案 0 :(得分:1)
您可以为sales_order_place_after
或sales_order_payment_place_end
<events>
<sales_order_place_after>
<observers>
<fraudtracking>
<type>singleton</type>
<class>fraudtracking/observer</class>
<method>changestatus</method>
</fraudtracking>
</observers>
</sales_order_place_after>
在你的observer.php
中//Create a new status in Admin -> System -> Order Statuses
$STATE = 'fraud';
$_order = $event->getOrder();
if($order->getPayment()->getTransaction()->getAdditionalInformation('avszip') != Y){
$_order->addStatusHistoryComment('Review for fraud', $STATE)
->setIsVisibleOnFront(false)
->setIsCustomerNotified(false);
}