Chr*_*tte 3 php status magento
我正在Magento商店工作,客户在订单上请求了一些自定义过滤器,以便在发送到履行之前对其进行人工审核.当这些案件出现时,订单将标有内置付款审核/可疑欺诈状态/状态.
我的问题是,在管理界面中,您似乎无法对付款审核状态中的订单做多少工作.我添加了一个自定义的"批准"类型按钮,用于手动批准订单,但如果它被审核并确认为欺诈,那么预期采取的措施是什么?我想取消或退还订单,但似乎不允许.检查canCancel或canCreditmemo订单返回false.对于像这样的场景,使用保持状态或付款评论更好吗?
Mage_Sales_Model_Order我没有覆盖对象(不是非常理想),而是在Magento工具包中发现了一些现有的钩子,它们可以在使用Suspected Fraud状态标记Order之后启用管理员操作.要启用这些,需要执行以下步骤:
在您的付款方式(继承自Mage_Payment_Model_Method_Abstract)中,添加以下内容:
protected $_canReviewPayment = true;
public function acceptPayment(Mage_Payment_Model_Info $payment) {
parent::acceptPayment($payment);
//perform gateway actions to remove Fraud flags. Capture should not occur here
return true;
//returning true will trigger a capture on any existing invoices, otherwise the admin can manually Invoice the order
}
public function denyPayment(Mage_Payment_Model_Info $payment) {
parent::denyPayment($payment);
//if your payment gateway supports it, you should probably void any pre-auth
return true;
}
Run Code Online (Sandbox Code Playgroud)
Magento的订单视图块将检查$order->canReviewPayment()哪个将查看_canReviewPayment付款方式上的变量,如果为真,则在订单视图上显示两个按钮:"接受付款"和"拒绝付款".点击后,我们刚刚添加的两个新的付款方式功能将被调用.
如果您已经拥有与订单相关联的发票,那么它将是pay'd或cancel'd.看看Mage_Sales_Model_Order_Payment::registerPaymentReviewAction更多细节.
| 归档时间: |
|
| 查看次数: |
7577 次 |
| 最近记录: |