Example #1
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="connection">PaymentConnection Object</param>
        /// <param name="paramList">Parameter List</param>
        /// <param name="psmContext">Context Object by ref</param>
        /// <remarks>This is an abstract class, creating an object of PaymentState directly is not possible.</remarks>
        public PaymentState(PaymentConnection connection, string paramList, ref Context psmContext) : this()
        {
            Logger.Instance.Log(
                "PayPal.Payments.Communication.PaymentState.PaymentState(PaymentConnection,String,Context): Entered.",
                PayflowConstants.SeverityDebug);

            CommContext = psmContext;
            Connection  = connection;
            InitializeContentType(paramList);


            if (CommContext.HighestErrorLvl < PayflowConstants.SeverityFatal)
            {
                Connection.ContentType = _mContentType;

                if (paramList == null || paramList.Length == 0)
                {
                    var err = PayflowUtility.PopulateCommError(PayflowConstants.EEmptyParamList, null,
                                                               PayflowConstants.SeverityFatal,
                                                               IsXmlPayRequest, null);
                    CommContext.AddError(err);
                }

                TransactionRequest = paramList;

                ValidateRequestId();
            }

            Logger.Instance.Log(
                "PayPal.Payments.Communication.PaymentState.PaymentState(PaymentConnection,String,Context): Exiting.",
                PayflowConstants.SeverityDebug);
        }
 /// <summary>
 ///     Private constructor for PaymentStateMachine
 /// </summary>
 private PaymentStateMachine()
 {
     _psmContext  = new Context();
     _mConnection = new PaymentConnection(ref _psmContext);
 }
 /// <summary>
 ///     Constructor for InitState.
 /// </summary>
 /// <param name="connection">PaymentConnection Object.</param>
 /// <param name="initialParameterList">Initial Parameter list.</param>
 /// <param name="psmContext">Context Object by ref</param>
 public InitState(PaymentConnection connection, string initialParameterList, ref Context psmContext) : base(
         connection, initialParameterList, ref psmContext)
 {
 }