cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Capture Amount

I have the Payment Action set to Authorize only in the backend of my Magento store.  When I go to capture the order at a later time through my backend, I get an error stating "Invalid order amount".   Anyone know why?

novidecor
Member
6 REPLIES 6

I meant "Invalid Capture Amount".

novidecor
Member

This will probably be something that has to be answered by an expert on Magento. The specific error text of "Invalid Capture Amount" doesn't exist in our system.  We have similar messages for when an attempt is made to capture a transaction for more than what was authorized, but I have no way of knowing what's going on when you hit that capture button.

    /**

     * Send capture request to gateway

     *

     * @param Mage_Payment_Model_Info $payment

     * @param decimal $amount

     * @return Mage_Paygate_Model_Authorizenet

     */

    public function capture(Varien_Object $payment, $amount)

    {

        if ($amount <= 0) {

            Mage::throwException(Mage::helper('paygate')->__('Invalid amount for capture.'));

        }

        $this->_initCardsStorage($payment);

        if ($this->_isPreauthorizeCapture($payment)) {

            $this->_preauthorizeCapture($payment, $amount);

        } else if ($this->isPartialAuthorization($payment)) {

            $this->_partialAuthorization($payment, $amount, self::REQUEST_TYPE_AUTH_CAPTURE);

        } else {

            $this->_place($payment, $amount, self::REQUEST_TYPE_AUTH_CAPTURE);

        }

        $payment->setSkipTransactionCreation(true);

        return $this;

    }

 

This the code from the back of magento.  Its trying to capture $0.  Do you know why?

Hey novidecor,

 

Unfortunately, we're still not going to be able to help you out with this as it's too Magento-specific. I would really suggest contacting them to see if they can help you out.

 

Thanks,

 

Michelle

Developer Community Manager

You need to comment in a file app/code/core/Mage/Paygate/Model/Authorizenet.php following code

 

if ($this->_formatAmount(
$cardsStorage->getProcessedAmount() - $cardsStorage->getCapturedAmount()) < $requestedAmount
) {
//Mage::throwException(Mage::helper('paygate')->__('Invalid amount for capture.'));
}

 

You need to comment in a file app/code/core/Mage/Paygate/Model/Authorizenet.php following code

 

if ($this->_formatAmount(
$cardsStorage->getProcessedAmount() - $cardsStorage->getCapturedAmount()) < $requestedAmount
) {
//Mage::throwException(Mage::helper('paygate')->__('Invalid amount for capture.'));
}