Magento – how do i set the paid amount and due amount manually after successful transaction in magento

magento

im running magento store 1.9.
please have a look at this scenario :

Grand total : 28000 Rs

I have special payment rule like:

if the grand total is greater than 25000 Rs then i will forward 30% of grand total to payment gateway for processing.
as usual payment gateway will process it accordingly and im getting the response as success.

after receiving payment success message, magento is saving order.
but the problem arises when i create an invoice from admin panel, even if the user had not paid the total amount completely, the invoice is creating as :

Grand Total : 28000

Total Paid : 28000

Total Due : 0.00

But the actual paid amount is 30% of Grand total.
we are using PayU india PG.

i can see that the payU integration code is doing the following after successful transaction

    $order = Mage::getModel('sales/order'); 
    -
    -
    -
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
                    $order->save();
                    $order->sendNewOrderEmail();

is there any way to set paid amount and manually, and hence there by to get due amount too?

i had tried :

 $order->setBaseTotalPaid($amount)  

but no use!!

Best Answer

i got it working by :

$order->setTotalPaid($amount);  

and the due amount is set automatically!!!

Related Topic