Пример #1
0
 /// <summary>
 /// Initializes a new instance of the Transaction class.
 /// </summary>
 /// <param name="status">Status onject.</param>
 /// <param name="reference">string reference.</param>
 /// <param name="internalReference">int internal reference.</param>
 /// <param name="paymentMethod">string payment method.</param>
 /// <param name="paymentMethodName">string paymen method name.</param>
 /// <param name="issuerName">string issuer name.</param>
 /// <param name="amount">AmountConversion object.</param>
 /// <param name="authorization">string authorization code.</param>
 /// <param name="receipt">long receip number.</param>
 /// <param name="franchise">string franchise.</param>
 /// <param name="refunded">bool refunded.</param>
 /// <param name="processorFields">List of NameValuePair objects.</param>
 public Transaction(
     Status status,
     string reference,
     int internalReference,
     string paymentMethod,
     string paymentMethodName,
     string issuerName,
     AmountConversion amount,
     string authorization,
     long receipt,
     string franchise,
     bool refunded,
     List <NameValuePair> processorFields
     )
 {
     this.status            = status;
     this.reference         = reference;
     this.internalReference = internalReference;
     this.paymentMethod     = paymentMethod;
     this.paymentMethodName = paymentMethodName;
     this.issuerName        = issuerName;
     this.amount            = amount;
     this.authorization     = authorization;
     this.receipt           = receipt;
     this.franchise         = franchise;
     this.refunded          = refunded;
     this.processorFields   = processorFields;
 }
Пример #2
0
        /// <summary>
        /// Set amount base data.
        /// </summary>
        /// <param name="data">AmountBase object data.</param>
        /// <returns>Transaction current instance.</returns>
        public Transaction SetAmountBase(object data)
        {
            if (data.GetType() == typeof(JObject))
            {
                data = new AmountBase((JObject)data);
            }

            if (!(data.GetType() == typeof(AmountBase)))
            {
                data = null;
            }

            amount = new AmountConversion().SetAmountBase(data);

            return(this);
        }
Пример #3
0
        /// <summary>
        /// Set amount property data.
        /// </summary>
        /// <param name="data">amount object data.</param>
        /// <returns>Transaction current instance.</returns>
        public new Transaction SetAmount(object data)
        {
            if (data.GetType() == typeof(JObject))
            {
                data = new AmountConversion((JObject)data);
            }

            if (!(data.GetType() == typeof(AmountConversion)))
            {
                data = null;
            }

            amount = (AmountConversion)data;

            return(this);
        }