예제 #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.SEVERITY_DEBUG);

            mContext    = PsmContext;
            mConnection = Connection;
            InitializeContentType(ParamList);



            if (mContext.HighestErrorLvl < PayflowConstants.SEVERITY_FATAL)
            {
                mConnection.ContentType = mContentType;

                if (ParamList == null || ParamList.Length == 0)
                {
                    ErrorObject Err = PayflowUtility.PopulateCommError(PayflowConstants.E_EMPTY_PARAM_LIST, null, PayflowConstants.SEVERITY_FATAL,
                                                                       IsXmlPayRequest, null);
                    mContext.AddError(Err);
                }

                this.mTransactionRequest = ParamList;

                ValidateRequestId();
            }
            Logger.Instance.Log("PayPal.Payments.Communication.PaymentState.PaymentState(PaymentConnection,String,Context): Exiting.", PayflowConstants.SEVERITY_DEBUG);
        }
예제 #2
0
        /// <summary>
        /// Copy Constructor
        /// </summary>
        /// <param name="CurrentPmtState">Current PaymentState Object.</param>
        /// <remarks>This is an abstract class, creating an object of PaymentState directly is not possible.</remarks>
        public PaymentState(PaymentState CurrentPmtState)
        {
            Logger.Instance.Log("PayPal.Payments.Communication.PaymentState.PaymentState(PaymentState CurrentPmtState): Entered.", PayflowConstants.SEVERITY_DEBUG);

            mDefaultXmlNameSpace             = PayflowConstants.XMLPAY_NAMESPACE;
            this.mConnection                 = CurrentPmtState.Connection;
            this.mParameterList              = CurrentPmtState.ParameterList;
            this.mTransactionRequest         = CurrentPmtState.TransactionRequest;
            this.mTransactionResponse        = CurrentPmtState.TransactionResponse;
            this.mConnection.RequestId       = CurrentPmtState.mConnection.RequestId;
            this.mConnection.IsXmlPayRequest = CurrentPmtState.mConnection.IsXmlPayRequest;
            this.mAttemptNo           = CurrentPmtState.AttemptNo;
            this.mDefaultXmlNameSpace = CurrentPmtState.mDefaultXmlNameSpace;
            this.PFProXmlNameSpace    = CurrentPmtState.XmlNameSpace;
            this.mContentType         = CurrentPmtState.ContentType;
            this.mContext             = CurrentPmtState.CommContext;
            Logger.Instance.Log("PayPal.Payments.Communication.PaymentState.PaymentState(PaymentState CurrentPmtState): Exiting.", PayflowConstants.SEVERITY_DEBUG);
        }
 /// <summary>
 /// Private constructor for PaymentStateMachine
 /// </summary>
 private PaymentStateMachine()
 {
     psmContext  = new Context();
     mConnection = new PaymentConnection(ref psmContext);
 }
예제 #4
0
 /// <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)
 {
 }