I am creating a script in which I am getting order data from third party. Everything is working fine, the issue is that I am unable to add storecredit to order. Is there any way to add store credit in order and substract them from grandtotal. Here is my code:
$order->setDiscountAmount($total_discount)->setBaseDiscountAmout($total_discount);
$order->setSubtotal($total_amount)->setBaseSubtotal($total_amount);
$order->setGrandTotal($total_amount-$total_discount)->setBaseGrandTotal($total_amount-$total_discount);
$order->save();
I wanted to do the same thing, and looking at the comments, I think it's ridiculous that this thread just died. Either you are here to help and assist, or you are not. If the thread dies because you enforce a question standard, is that helpful?
Here is how to do it.
Enterprise_CustomerBalance_Block_Checkout_Onepage_Payment_Additional has some methods which you can use
Finally, when credit is applied, at the checkout make sure that you set the following