コード例 #1
0
        /// <summary>
        /// Builds the PTS file representation for the specified record.
        /// </summary>
        /// <param name="record">
        /// The record for which to build a PTS file representation.
        /// </param>
        /// <param name="recordSequenceNumber">
        /// The record sequence number to place in the PTS file for the specified record.
        /// </param>
        /// <returns>
        /// The PTS file representation for the specified record.
        /// </returns>
        internal static string Build(OutstandingRedeemedDealInfo record,
                                     int recordSequenceNumber)
        {
            StringBuilder result = new StringBuilder(PtsConstants.RecordLength);

            // Tokenization record ID
            result.Append(RecordId);

            // Record sequence number
            string sequenceNumber = recordSequenceNumber.ToString();

            result.Append(PtsConstants.RecordSequenceNumberPad,
                          PtsConstants.RecordSequenceNumberLength - sequenceNumber.Length);
            result.Append(sequenceNumber);

            // Token
            result.Append(record.Token);
            result.Append(TokenPad, TokenLength - record.Token.Length);

            // Token type
            result.Append(TokenType);

            // Filler
            result.Append(PtsConstants.FillerPad, FillerLength);

            return(result.ToString());
        }
コード例 #2
0
 /// <summary>
 /// Updates the pending redeemed deals in the merchant record list to the credit status specified, if the credit status
 /// is valid.
 /// </summary>
 /// <param name="record">
 /// Merchant record whose redeemed deal to update.
 /// </param>
 /// <param name="creditStatus">
 /// The credit status to which to set the redeemed deals.
 /// </param>
 /// <exception cref="InvalidOperationException">
 /// Parameter creditStatus contains an invalid CreditStatus for this operation.
 /// </exception>
 internal void UpdatePendingRedeemedDeals(OutstandingRedeemedDealInfo record, CreditStatus creditStatus)
 {
     // Update the credit status for the specified list of merchant records.
     WorkerActions.UpdatePendingRedeemedDeals(new Collection <OutstandingRedeemedDealInfo> {
         record
     }, creditStatus, RedeemedDealOperations, Context);
 }
        /// <summary>
        /// Builds the PTS file representation for the specified record.
        /// </summary>
        /// <param name="record">
        /// The record for which to build a PTS file representation.
        /// </param>
        /// <param name="recordSequenceNumber">
        /// The record sequence number to place in the PTS file for the specified record.
        /// </param>
        /// <param name="forNonFirstDataPartners">
        /// Will be set to True if PTS being built is for Non-FDC (like Visa) partners
        /// </param>
        /// <returns>
        /// The PTS file representation for the specified record.
        /// </returns>
        internal static string Build(OutstandingRedeemedDealInfo record,
                                     int recordSequenceNumber,
                                     bool forNonFirstDataPartners)
        {
            StringBuilder result = new StringBuilder(PtsConstants.RecordLength);

            // AcquirerReferenceNumber record ID
            result.Append(RecordId);

            // Record sequence number
            string sequenceNumber = recordSequenceNumber.ToString();

            result.Append(PtsConstants.RecordSequenceNumberPad,
                          PtsConstants.RecordSequenceNumberLength - sequenceNumber.Length);
            result.Append(sequenceNumber);

            if (forNonFirstDataPartners)
            {
                BuildForNonFirstData(record, result);
            }
            else
            {
                BuildForFirstData(record, result);
            }

            // Filler (and unused fields).
            result.Append(PtsConstants.FillerPad, FillerLength);

            return(result.ToString());
        }
 /// <summary>
 /// Append data for Non-FDC partners
 /// </summary>
 /// <param name="record">
 /// The record for which to build a PTS file representation.
 /// </param>
 /// <param name="result">
 /// Stringbuilder holding existing representation
 /// </param>
 private static void BuildForNonFirstData(OutstandingRedeemedDealInfo record, StringBuilder result)
 {
     result.Append("M");
     result.Append(record.TransactionDate.ToString("yyyyMMdd"));
     result.Append("REV");
     result.Append("0000000");
     result.Append("MSFT");
 }
コード例 #5
0
        /// <summary>
        /// Builds the PTS file representation for the specified record.
        /// </summary>
        /// <param name="record">
        /// The record for which to build a PTS file representation.
        /// </param>
        /// <param name="recordSequenceNumber">
        /// The record sequence number to place in the PTS file for the specified record.
        /// </param>
        /// <returns>
        /// The PTS file representation for the specified record.
        /// </returns>
        internal static string Build(OutstandingRedeemedDealInfo record,
                                     int recordSequenceNumber)
        {
            StringBuilder result = new StringBuilder(PtsConstants.RecordLength);

            // Transaction detail record ID
            result.Append(RecordId);

            // Filler
            result.Append(PtsConstants.AlternateFillerPad, FirstFillerLength);

            // Transaction code
            result.Append(TransactionCode);

            // Discount amount.
            string discountAmount = record.DiscountAmount.ToString();

            result.Append(DiscountAmountPad, DiscountAmountLength - discountAmount.Length);
            result.Append(discountAmount);

            // Transaction date.
            result.Append(record.TransactionDate.ToString("MMdd"));

            // Filler
            result.Append(PtsConstants.FillerPad, SecondFillerLength);

            // Filler
            result.Append(PtsConstants.AlternateFillerPad, ThirdFillerLength);

            // Reference number. Limit to eight places. (Overflow is okay because numbers do not have to be absolutely unique).
            string referenceNumber = record.ReferenceNumber.ToString().PadLeft(Int32MaxLength, ReferenceNumberPad);

            referenceNumber = referenceNumber.Substring(Int32MaxLength - ReferenceNumberLength);
            result.Append(referenceNumber);

            // Record sequence number
            string sequenceNumber = recordSequenceNumber.ToString();

            result.Append(PtsConstants.RecordSequenceNumberPad,
                          PtsConstants.RecordSequenceNumberLength - sequenceNumber.Length);
            result.Append(sequenceNumber);

            // Filler
            result.Append(PtsConstants.FillerPad, FourthFillerLength);

            // Filler
            result.Append(PtsConstants.AlternateFillerPad, FifthFillerLength);

            // Filler
            result.Append(PtsConstants.FillerPad, SixthFillerLength);

            return(result.ToString());
        }
 /// <summary>
 /// Append data for FDC
 /// </summary>
 /// <param name="record">
 /// The record for which to build a PTS file representation.
 /// </param>
 /// <param name="result">
 /// Stringbuilder holding existing representation
 /// </param>
 private static void BuildForFirstData(OutstandingRedeemedDealInfo record, StringBuilder result)
 {
     // Acquirer reference number.
     result.Append(record.AcquirerReferenceNumber);
 }
コード例 #7
0
        /// <summary>
        /// Builds the PTS file representation for the specified record.
        /// </summary>
        /// <param name="record">
        /// The record for which to build a PTS file representation.
        /// </param>
        /// <param name="recordSequenceNumber">
        /// The record sequence number to place in the PTS file for the specified record.
        /// </param>
        /// <param name="forNonFirstDataPartners">
        /// Will be set to True if PTS being built is for Non-FDC (like Visa) partners
        /// </param>
        /// <returns>
        /// The PTS file representation for the specified record.
        /// </returns>
        internal static string Build(OutstandingRedeemedDealInfo record,
                                     int recordSequenceNumber,
                                     bool forNonFirstDataPartners)
        {
            StringBuilder result = new StringBuilder(PtsConstants.RecordLength);

            // Special condition record ID
            result.Append(RecordId);

            // Non-quasi-cash indicator
            result.Append(NonQuasiCashIndicator);

            // No special condition indicator
            result.Append(NoSpecialConditionIndicator);

            // Clearing sequence
            result.Append(ClearingSequence);

            // Cleaing count
            result.Append(ClearingCount);

            // Print customer service phone number
            result.Append(PrintCustomerServicePhoneNumberIndicator);

            // First filler
            result.Append(PtsConstants.FillerPad, FirstFillerLength);

            // Record sequence number
            string sequenceNumber = recordSequenceNumber.ToString();

            result.Append(PtsConstants.RecordSequenceNumberPad,
                          PtsConstants.RecordSequenceNumberLength - sequenceNumber.Length);
            result.Append(sequenceNumber);

            // Second filler
            result.Append(PtsConstants.FillerPad, SecondFillerLength);

            // Offerwise or not
            if (forNonFirstDataPartners)
            {
                result.Append(NonOfferWise);
            }
            else
            {
                result.Append(Offerwise);
            }

            // Partial offer ID
            // in non FDC path, it can be less than expected length, so pad it if such is the case
            if (record.OfferId.Length < PartialOfferIdLength)
            {
                record.OfferId = record.OfferId.PadRight(PartialOfferIdLength, '0');
            }

            // Partial offer ID
            result.Append(record.OfferId.Substring(0, PartialOfferIdLength).ToUpperInvariant());

            // Filler (and unused fields)
            result.Append(PtsConstants.FillerPad, ThirdFillerLength);

            return(result.ToString());
        }