When I make a payment using both gift card and by redeeming points, both the payments go through but my gift card is charged the grand total instead of (grand total-rewards currency amount). On the cart calculations are done properly but this problem only arises after I press confirm order. Is there a specific way I should be handling gift card payments because right now I am just adding it to 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());
}
}
Order Details after confirming order: Order Total before payment was $48.58, used $45 from points and gift card should’ve been charged $4.58