Example #1
0
        public SelectionDetail(int selectionIndex, IResponseReason reason, IRejectionInfo rejectionInfo)
        {
            Guard.Argument(selectionIndex, nameof(selectionIndex)).InRange(0, 62);
            Guard.Argument(reason, nameof(reason)).NotNull();

            SelectionIndex = selectionIndex;
            Reason         = reason;
            RejectionInfo  = rejectionInfo;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BetDetail"/> class
        /// </summary>
        /// <param name="betId">The bet identifier</param>
        /// <param name="reason">The reason</param>
        /// <param name="alternativeStake">The alternative stake</param>
        /// <param name="reoffer">The reoffer</param>
        /// <param name="selectionDetails">The selection details</param>
        public BetDetail(string betId,
                         IResponseReason reason,
                         IAlternativeStake alternativeStake,
                         IBetReoffer reoffer,
                         IEnumerable <ISelectionDetail> selectionDetails)
        {
            Guard.Argument(betId, nameof(betId)).NotNull().NotEmpty().Require(betId.Length <= 128);
            Guard.Argument(reason, nameof(reason)).NotNull();

            BetId            = betId;
            Reason           = reason;
            AlternativeStake = alternativeStake;
            SelectionDetails = selectionDetails;
            Reoffer          = reoffer;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TicketNonSrSettleResponse"/> class
        /// </summary>
        /// <param name="ticketNonSrSetter">The ticket non-sr settle sender</param>
        /// <param name="ticketId">The ticket identifier</param>
        /// <param name="status">The status</param>
        /// <param name="reason">The reason</param>
        /// <param name="correlationId">The correlation id</param>
        /// <param name="signature">The signature</param>
        /// <param name="version">The version</param>
        /// <param name="additionalInfo">The additional information</param>
        /// <param name="orgJson">The original json string received from the mts</param>
        public TicketNonSrSettleResponse(ITicketSender ticketNonSrSetter,
                                         string ticketId,
                                         NonSrSettleAcceptance status,
                                         IResponseReason reason,
                                         string correlationId,
                                         string signature,
                                         string version = TicketHelper.MtsTicketVersion,
                                         IDictionary <string, string> additionalInfo = null,
                                         string orgJson = null)
        {
            TicketId       = ticketId;
            Status         = status;
            Reason         = reason;
            Signature      = signature;
            Version        = version;
            Timestamp      = DateTime.UtcNow;
            CorrelationId  = correlationId;
            AdditionalInfo = additionalInfo;
            _originalJson  = orgJson;

            _ticketNonSrSettle = ticketNonSrSetter;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TicketResponse"/> class
        /// </summary>
        /// <param name="ticketSender">The ticket sender</param>
        /// <param name="ticketId">The ticket identifier</param>
        /// <param name="status">The status</param>
        /// <param name="reason">The reason</param>
        /// <param name="betDetails">The bet details</param>
        /// <param name="correlationId">The correlation id</param>
        /// <param name="signature">The signature</param>
        /// <param name="exchangeRate">The exchange rate</param>
        /// <param name="version">The version</param>
        /// <param name="additionalInfo">The additional information</param>
        /// <param name="autoAcceptedOdds">Auto accepted odds</param>
        /// <param name="orgJson">The original json string received from the mts</param>
        public TicketResponse(ITicketSender ticketSender,
                              string ticketId,
                              TicketAcceptance status,
                              IResponseReason reason,
                              IEnumerable <IBetDetail> betDetails,
                              string correlationId,
                              string signature  = null,
                              long exchangeRate = -1,
                              string version    = TicketHelper.MtsTicketVersion,
                              IDictionary <string, string> additionalInfo      = null,
                              IEnumerable <IAutoAcceptedOdds> autoAcceptedOdds = null,
                              string orgJson = null)
        {
            Guard.Argument(ticketId, nameof(ticketId)).Require(TicketHelper.ValidateTicketId(ticketId));
            Guard.Argument(version, nameof(version)).NotNull().NotEmpty();

            TicketId = ticketId;
            Status   = status;
            Reason   = reason;
            if (betDetails != null)
            {
                BetDetails = betDetails as IReadOnlyCollection <IBetDetail>;
            }
            Signature      = signature;
            ExchangeRate   = exchangeRate;
            Version        = version;
            Timestamp      = DateTime.UtcNow;
            CorrelationId  = correlationId;
            AdditionalInfo = additionalInfo != null && additionalInfo.Any()
                                 ? additionalInfo
                                 : null;
            AutoAcceptedOdds = autoAcceptedOdds;
            _originalJson    = orgJson;

            _ticketSender = ticketSender;
        }
Example #5
0
 private static void Compare(IResponseReason reason, SDK.Entities.Internal.Dto.TicketResponse.Reason dto)
 {
     Assert.AreEqual(reason.Code, dto.Code);
     Assert.AreEqual(reason.Message, dto.Message);
 }