コード例 #1
0
        /// <summary>
        /// Updates gift card details.
        /// </summary>
        /// <param name="updated"></param>
        /// <param name="comment"></param>
        /// <param name="gcTenderLineItem"></param>
        public void UpdateGiftCard(ref bool updated, ref string comment, IGiftCardTenderLineItem gcTenderLineItem)
        {
            LogMessage("Reedming money from gift card.",
                       LSRetailPosis.LogTraceLevel.Trace,
                       "GiftCard.UpdateGiftCard");

            GiftCertificateTenderLineItem giftCardTenderLineItem = gcTenderLineItem as GiftCertificateTenderLineItem;

            if (giftCardTenderLineItem == null)
            {
                throw new ArgumentNullException("gcTenderLineItem");
            }

            decimal balance = 0;

            // Begin by checking if there is a connection to the Transaction Service
            if (this.Application.TransactionServices.CheckConnection())
            {
                this.Application.TransactionServices.GiftCardPayment(ref updated, ref comment, ref balance,
                                                                     giftCardTenderLineItem.SerialNumber, giftCardTenderLineItem.Transaction.StoreId,
                                                                     giftCardTenderLineItem.Transaction.TerminalId, giftCardTenderLineItem.Transaction.OperatorId,
                                                                     giftCardTenderLineItem.Transaction.TransactionId, giftCardTenderLineItem.Transaction.ReceiptId,
                                                                     ApplicationSettings.Terminal.StoreCurrency, giftCardTenderLineItem.Amount, DateTime.Now);

                // Update the balance in Tender line item.
                giftCardTenderLineItem.Balance = balance;
            }
        }
コード例 #2
0
        /// <summary>
        /// Void payment of gift card.
        /// </summary>
        /// <param name="voided"></param>
        /// <param name="comment"></param>
        /// <param name="gcTenderLineItem"></param>
        public void VoidGiftCardPayment(ref bool voided, ref string comment, IGiftCardTenderLineItem gcTenderLineItem)
        {
            LogMessage("Cancelling the used marking of the gift card.",
                       LSRetailPosis.LogTraceLevel.Trace,
                       "GiftCard.VoidGiftCardPayment");

            GiftCertificateTenderLineItem giftCardTenderLineItem = gcTenderLineItem as GiftCertificateTenderLineItem;

            if (giftCardTenderLineItem == null)
            {
                throw new ArgumentNullException("gcTenderLineItem");
            }

            if (this.Application.TransactionServices.CheckConnection())
            {
                this.Application.TransactionServices.VoidGiftCardPayment(ref voided, ref comment, giftCardTenderLineItem.SerialNumber,
                                                                         giftCardTenderLineItem.Transaction.StoreId, giftCardTenderLineItem.Transaction.TerminalId);
            }
        }