When payment is done by redeeming points in conjunction with a gift card, the gift card gets charged the whole value of the grand total inspite of redeeming points. I have added gift card to the quote programmatically like so:
private function _setGiftCard(&$quote)
{
try {
$cards = unserialize($quote->getGiftCards());
foreach ($cards as $card) {
$currentCard = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->load($card['i']);
if ($currentCard->getId()) {
$currentCard->removeFromCart(true, $quote);
}
}
$giftCard = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->loadByCode($this->_giftCard);
$cid = $this->_getRead()->fetchOne('SELECT customer_id FROM do_customer_giftcard WHERE giftcard_id='.$giftCard->getId());
if($cid!=$this->_customerId) throw new Exception('no ownership');
$giftCard->addToCart(true, $quote);
} catch (Exception $e) {
throw new Goopter_Gift_Card_Exception($e->getMessage());
}
}
And Points Value calculated if added to quote using set methods. Seems like gift card payment does not recognize the payment by points. Any help would be much appreciated. Thanks!