private static void PopulateFromReader(PayPalLog payPalLog, IDataReader reader) { if (reader.Read()) { payPalLog.rowGuid = new Guid(reader["RowGuid"].ToString()); payPalLog.createdUtc = Convert.ToDateTime(reader["CreatedUtc"]); payPalLog.siteGuid = new Guid(reader["SiteGuid"].ToString()); payPalLog.userGuid = new Guid(reader["UserGuid"].ToString()); payPalLog.storeGuid = new Guid(reader["StoreGuid"].ToString()); payPalLog.cartGuid = new Guid(reader["CartGuid"].ToString()); payPalLog.requestType = reader["RequestType"].ToString(); payPalLog.apiVersion = reader["ApiVersion"].ToString(); payPalLog.rawResponse = reader["RawResponse"].ToString(); payPalLog.token = reader["Token"].ToString(); payPalLog.payerId = reader["PayerId"].ToString(); payPalLog.transactionId = reader["TransactionId"].ToString(); payPalLog.paymentType = reader["PaymentType"].ToString(); payPalLog.paymentStatus = reader["PaymentStatus"].ToString(); payPalLog.pendingReason = reader["PendingReason"].ToString(); payPalLog.reasonCode = reader["ReasonCode"].ToString(); payPalLog.currencyCode = reader["CurrencyCode"].ToString(); payPalLog.exchangeRate = Convert.ToDecimal(reader["ExchangeRate"]); payPalLog.cartTotal = Convert.ToDecimal(reader["CartTotal"]); payPalLog.payPalAmt = Convert.ToDecimal(reader["PayPalAmt"]); payPalLog.taxAmt = Convert.ToDecimal(reader["TaxAmt"]); payPalLog.feeAmt = Convert.ToDecimal(reader["FeeAmt"]); payPalLog.settleAmt = Convert.ToDecimal(reader["SettleAmt"]); payPalLog.providerName = reader["ProviderName"].ToString(); payPalLog.returnUrl = reader["ReturnUrl"].ToString(); payPalLog.serializedObject = reader["SerializedObject"].ToString(); payPalLog.pdtProviderName = reader["PDTProviderName"].ToString(); payPalLog.ipnProviderName = reader["IPNProviderName"].ToString(); payPalLog.response = reader["Response"].ToString(); } }
public static PayPalLog GetMostRecent(Guid cartGuid, string requestType) { PayPalLog log = new PayPalLog(); using (IDataReader reader = DBPayPalLog.GetMostRecentLog(cartGuid, requestType)) { PopulateFromReader(log, reader); } if (log.RowGuid == Guid.Empty) { return(null); } return(log); }
public static PayPalLog GetSetExpressCheckout(string token) { PayPalLog log = new PayPalLog(); using (IDataReader reader = DBPayPalLog.GetSetExpressCheckout(token)) { PopulateFromReader(log, reader); } if (log.RowGuid == Guid.Empty) { return(null); } return(log); }
///// <summary> ///// Gets a count of PayPalLog. ///// </summary> //public static int GetCount() //{ // return DBPayPalLog.GetCount(); //} private static List <PayPalLog> LoadListFromReader(IDataReader reader) { List <PayPalLog> payPalLogList = new List <PayPalLog>(); try { while (reader.Read()) { PayPalLog payPalLog = new PayPalLog(); payPalLog.rowGuid = new Guid(reader["RowGuid"].ToString()); payPalLog.createdUtc = Convert.ToDateTime(reader["CreatedUtc"]); payPalLog.siteGuid = new Guid(reader["SiteGuid"].ToString()); payPalLog.userGuid = new Guid(reader["UserGuid"].ToString()); payPalLog.storeGuid = new Guid(reader["StoreGuid"].ToString()); payPalLog.cartGuid = new Guid(reader["CartGuid"].ToString()); payPalLog.requestType = reader["RequestType"].ToString(); payPalLog.apiVersion = reader["ApiVersion"].ToString(); payPalLog.rawResponse = reader["RawResponse"].ToString(); payPalLog.token = reader["Token"].ToString(); payPalLog.payerId = reader["PayerId"].ToString(); payPalLog.transactionId = reader["TransactionId"].ToString(); payPalLog.paymentType = reader["PaymentType"].ToString(); payPalLog.paymentStatus = reader["PaymentStatus"].ToString(); payPalLog.pendingReason = reader["PendingReason"].ToString(); payPalLog.reasonCode = reader["ReasonCode"].ToString(); payPalLog.currencyCode = reader["CurrencyCode"].ToString(); payPalLog.exchangeRate = Convert.ToDecimal(reader["ExchangeRate"]); payPalLog.cartTotal = Convert.ToDecimal(reader["CartTotal"]); payPalLog.payPalAmt = Convert.ToDecimal(reader["PayPalAmt"]); payPalLog.taxAmt = Convert.ToDecimal(reader["TaxAmt"]); payPalLog.feeAmt = Convert.ToDecimal(reader["FeeAmt"]); payPalLog.settleAmt = Convert.ToDecimal(reader["SettleAmt"]); payPalLog.providerName = reader["ProviderName"].ToString(); payPalLog.returnUrl = reader["ReturnUrl"].ToString(); payPalLog.serializedObject = reader["SerializedObject"].ToString(); payPalLogList.Add(payPalLog); } } finally { reader.Close(); } return(payPalLogList); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByCurrencyCode(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.CurrencyCode.CompareTo(payPalLog2.CurrencyCode)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByReasonCode(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.ReasonCode.CompareTo(payPalLog2.ReasonCode)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByPendingReason(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.PendingReason.CompareTo(payPalLog2.PendingReason)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByPaymentStatus(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.PaymentStatus.CompareTo(payPalLog2.PaymentStatus)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByPaymentType(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.PaymentType.CompareTo(payPalLog2.PaymentType)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByTransactionId(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.TransactionId.CompareTo(payPalLog2.TransactionId)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByPayerId(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.PayerId.CompareTo(payPalLog2.PayerId)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByToken(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.Token.CompareTo(payPalLog2.Token)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByRawResponse(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.RawResponse.CompareTo(payPalLog2.RawResponse)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByApiVersion(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.ApiVersion.CompareTo(payPalLog2.ApiVersion)); }
/// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByRequestType(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.RequestType.CompareTo(payPalLog2.RequestType)); }
///// <summary> ///// Gets an IList with page of instances of PayPalLog. ///// </summary> ///// <param name="pageNumber">The page number.</param> ///// <param name="pageSize">Size of the page.</param> ///// <param name="totalPages">total pages</param> //public static List<PayPalLog> GetPage(int pageNumber, int pageSize, out int totalPages) //{ // totalPages = 1; // IDataReader reader = DBPayPalLog.GetPage(pageNumber, pageSize, out totalPages); // return LoadListFromReader(reader); //} #endregion #region Comparison Methods /// <summary> /// Compares 2 instances of PayPalLog. /// </summary> public static int CompareByCreatedUtc(PayPalLog payPalLog1, PayPalLog payPalLog2) { return(payPalLog1.CreatedUtc.CompareTo(payPalLog2.CreatedUtc)); }