1
votes

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!!

2

2 Answers

4
votes

i got it working by :

$order->setTotalPaid($amount);  

and the due amount is set automatically!!!

0
votes

why you are not using recurring profile, I think you need to use recurring profile here that will give you option to create seperate invoice and you can create it later.