magento - "Suspected Fraud"完成magento付款后的状态?

标签 magento paypal payment

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

请让我知道我做错了什么。虽然折扣在订单信息中添加成功。

$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、Saved Card 等),因为每种方法都可以实现不同的交易授权、捕获等方法。

看看默认的 Mage_Sales_Model_Order_Payment 类。当尝试为交易捕获资金时,这会多次调用名为 $this->getIsFraudDetected() 的方法,如果 true 将订单状态设置为可疑欺诈,如下所示:

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

在默认支付类中,当 _isCaptureFinal() 方法返回 false 时,在 registerCaptureNotification() 方法中设置欺诈标志:

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));
}

当您 try catch 的金额不完全等于剩余订单余额时,_isCaptureFinal() 方法返回 false

/**
 * 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;
}

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

关于magento - "Suspected Fraud"完成magento付款后的状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9804883/

相关文章:

css - Magento:带有 CSS 的简单股票指标

magento - 使用 Magmi 中的“创建新项目”未出现产品

php - PayPal IPN 自定义表单数据

php - 如何自动化 Paypal 付款

Paypal HTML 集成问题(未显示经常性付款的销售税)

facebook - 测试 Facebook 支付中的争议和退款

Magento v1.7 - 新订单到达后管理员无法收到电子邮件

Magento 主题开发基础与默认主题

transactions - 对 ARQC 、 TC 、 AAC 和第二张卡操作分析的澄清

Paypal Adaptive Payments - 并行还是链接我的多供应商市场?