コード例 #1
0
 /**
  * Set the checkout step to return to when a redemption fails. Will set the
  * goto and update section to the given section.
  * One of: 'login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'
  * @param EbayEnterprise_GiftCard_Model_IGiftcard $card
  * @param string $message
  * @param bool $shouldRemoveCard Should the gift card also be removed from the order, default false
  * @return self
  */
 protected function _failGiftCardRedeem(EbayEnterprise_GiftCard_Model_IGiftcard $card, $message, $shouldRemoveCard = false)
 {
     if ($shouldRemoveCard) {
         $this->_giftCardContainer->removeGiftCard($card);
     }
     // always send back to payment step to review applied gift card amounts or
     // enter additional payment information
     $this->_getCheckoutSession()->setGotoSection('payment')->setUpdateSection('payment-method');
     // as gift cards will have been modified in this case, either removed or
     // amounts updated, recollect totals to ensure gift card amounts and payment
     // methods are properly updated
     $this->_getCheckoutSession()->getQuote()->setTotalsCollectedFlag(false)->collectTotals();
     throw Mage::exception('EbayEnterprise_GiftCard', $this->_helper->__($message, $card->getCardNumber(), $card->getAmountToRedeem(), $card->getAmountRedeemed()));
 }