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);
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.
Take a look at the default
Mage_Sales_Model_Order_Paymentclass. 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 iftruelike so:In the default Payment class the fraud flag is set in the
registerCaptureNotification()method when the_isCaptureFinal()method returnsfalse:The
_isCaptureFinal()methods returnsfalsewhen the amount you are trying to capture does not equal exactly the remaining order balance.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…