/// <summary>
        /// Lists transactions by state and type. Defaults to all.
        /// </summary>
        /// <param name="state"></param>
        /// <param name="type"></param>
        /// <param name="filter">FilterCriteria used to apply server side sorting and filtering</param>
        /// <returns></returns>
        public static RecurlyList <Transaction> List(TransactionList.TransactionState state,
                                                     TransactionList.TransactionType type,
                                                     FilterCriteria filter)
        {
            filter = filter ?? FilterCriteria.Instance;
            var parameters = filter.ToNamedValueCollection();

            if (state != TransactionList.TransactionState.All)
            {
                parameters["state"] = state.ToString().EnumNameToTransportCase();
            }
            if (type != TransactionList.TransactionType.All)
            {
                parameters["type"] = type.ToString().EnumNameToTransportCase();
            }

            return(new TransactionList(Transaction.UrlPrefix + "?" + parameters.ToString()));
        }
Пример #2
0
 /// <summary>
 /// Returns a list of transactions for this account, by transaction type
 /// </summary>
 /// <param name="state">Transactions of this state will be retrieved. Optional, default: All.</param>
 /// <param name="type">Transactions of this type will be retrieved. Optional, default: All.</param>
 /// <returns></returns>
 public RecurlyList <Transaction> GetTransactions(TransactionList.TransactionState state = TransactionList.TransactionState.All,
                                                  TransactionList.TransactionType type   = TransactionList.TransactionType.All)
 {
     return(new TransactionList(UrlPrefix + Uri.EscapeUriString(AccountCode) + "/transactions/"
                                + Build.QueryStringWith(state != TransactionList.TransactionState.All ? "state=" + state.ToString().EnumNameToTransportCase() : "")
                                .AndWith(type != TransactionList.TransactionType.All ? "type=" + type.ToString().EnumNameToTransportCase() : "")));
 }
Пример #3
0
 /// <summary>
 /// Lists transactions by state and type. Defaults to all.
 /// </summary>
 /// <param name="state"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static RecurlyList <Transaction> List(TransactionList.TransactionState state = TransactionList.TransactionState.All,
                                              TransactionList.TransactionType type   = TransactionList.TransactionType.All)
 {
     return(new TransactionList("/transactions/" +
                                Build.QueryStringWith(state != TransactionList.TransactionState.All ? "state=" + state.ToString().EnumNameToTransportCase() : "")
                                .AndWith(type != TransactionList.TransactionType.All ? "type=" + type.ToString().EnumNameToTransportCase() : "")
                                ));
 }