“涉嫌欺诈";在magento中完成付款后的状态如何? [英] "Suspected Fraud" status after compeleting the payment in magento?

查看:107
本文介绍了“涉嫌欺诈";在magento中完成付款后的状态如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在magento中制作了自定义模块,在其中我动态设置了折扣. 我为此使用以下代码. 但是,当我完成付款程序后,订单状态应该为"processing",而不是该订单状态为"Suspected Fraud".

I have made my custom module in magento, in which I have set discount in dynamically. I am using following code for this. But when I have completed the payment procedure, the order status should be 'processing' but instead of this order status become "Suspected Fraud".

请让我知道我做错了什么.尽管折扣已成功添加到订单信息中.

Please let me know what I have done wrong. Although discount added successfully in order information.

$order->setData('base_discount_amount', $discountAmt);

$order->setData('base_discount_canceled', $discountAmt);

$order->setData('base_discount_invoiced', $discountAmt);

$order->setData('base_discount_refunded', $discountAmt);

$order->setData('discount_description', 'Affliate Discount');

$order->setData('discount_amount', $discountAmt);

$order->setData('discount_canceled', $discountAmt);

$order->setData('discount_invoiced', $discountAmt);

$order->setData('discount_refunded', $discountAmt);

推荐答案

从您的问题中很难分辨出来.这可能取决于您使用哪种Magento支付网关/方法(Paypal,Authorize.net,已保存的卡等),因为每种方法都可以实现用于交易授权,捕获等的不同方法.

It's not easy to tell from your question. This can depend on which Magento payment gateway / method you are using (Paypal, Authorize.net, Saved Card etc) as each can implement different methods for transaction authorization, capturing etc.

看看默认的Mage_Sales_Model_Order_Payment类.在尝试为交易获取资金并将订单状态设置为可疑欺诈"时,有几个方法调用了$this->getIsFraudDetected()方法,如true所示:

Take a look at the default Mage_Sales_Model_Order_Payment class. This has several calls to a method called $this->getIsFraudDetected() when attempting to capture funds for a transaction and set the order status to Suspected Fraud if true like so:

if ($this->getIsFraudDetected()) {
    $status = Mage_Sales_Model_Order::STATUS_FRAUD;
}

在默认的Payment类中,当_isCaptureFinal()方法返回false时,在registerCaptureNotification()方法中设置了欺诈标记:

In the default Payment class the fraud flag is set in the registerCaptureNotification() method when the _isCaptureFinal() method returns false:

if ($this->_isCaptureFinal($amount)) {
    $invoice = $order->prepareInvoice()->register();
    $order->addRelatedObject($invoice);
    $this->setCreatedInvoice($invoice);
} else {
    $this->setIsFraudDetected(true);
    $this->_updateTotals(array('base_amount_paid_online' => $amount));
}

当您要捕获的金额不完全等于剩余订单余额时,_isCaptureFinal()方法将返回false.

The _isCaptureFinal() methods returns false when the amount you are trying to capture does not equal exactly the remaining order balance.

/**
 * Decide whether authorization transaction may close (if the amount to capture will cover entire order)
 * @param float $amountToCapture
 * @return bool
 */
protected function _isCaptureFinal($amountToCapture)
{
    $amountToCapture = $this->_formatAmount($amountToCapture, true);
    $orderGrandTotal = $this->_formatAmount($this->getOrder()->getBaseGrandTotal(), true);
    if ($orderGrandTotal == $this->_formatAmount($this->getBaseAmountPaid(), true) + $amountToCapture) {
        if (false !== $this->getShouldCloseParentTransaction()) {
            $this->setShouldCloseParentTransaction(true);
        }
        return true;
    }
    return false;
}

如果使用默认付款方式,请检查您的总计(请求的收入与未结余额),或查看您的付款方式的实现,并使用以上信息调试代码...

Check your totals (requested capture vs. outstanding balance) if using the default payment method or look at your payment methods implementation and use the above information to debug your code...

这篇关于“涉嫌欺诈";在magento中完成付款后的状态如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆