|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using Newtonsoft.Json; |
| 4 | +using Pingpp.Net; |
| 5 | +using Pingpp.Exception; |
| 6 | + |
| 7 | +namespace Pingpp.Models |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// 分账明细 |
| 11 | + /// </summary> |
| 12 | + public class ProfitTransaction:Pingpp |
| 13 | + { |
| 14 | + [JsonProperty("id")] |
| 15 | + public string Id { get; set; } |
| 16 | + [JsonProperty("object")] |
| 17 | + public string Object { get; set; } |
| 18 | + [JsonProperty("livemode")] |
| 19 | + public bool Livemode { get; set; } |
| 20 | + [JsonProperty("app")] |
| 21 | + public string App { get; set; } |
| 22 | + [JsonProperty("amount")] |
| 23 | + public int? Amount { get; set; } |
| 24 | + [JsonProperty("name")] |
| 25 | + public string Name { get; set; } |
| 26 | + [JsonProperty("status")] |
| 27 | + public string Status { get; set; } |
| 28 | + [JsonProperty("description")] |
| 29 | + public string Description { get; set; } |
| 30 | + [JsonProperty("split_receiver")] |
| 31 | + public string SplitReceiver { get; set; } |
| 32 | + [JsonProperty("split_profit")] |
| 33 | + public string SplitProfit { get; set; } |
| 34 | + [JsonProperty("created")] |
| 35 | + public int? Created { get; set; } |
| 36 | + [JsonProperty("time_finished")] |
| 37 | + public int? TimeFinished { get; set; } |
| 38 | + [JsonProperty("failure_msg")] |
| 39 | + public string FailureMsg { get; set; } |
| 40 | + |
| 41 | + [JsonProperty("currency")] |
| 42 | + public string Currency { get; set; } |
| 43 | + |
| 44 | + private const string BaseUrl = "/v1/profit_transactions"; |
| 45 | + /// <summary> |
| 46 | + /// 分账明细查询 |
| 47 | + /// </summary> |
| 48 | + /// <param name="ptxnId"></param> |
| 49 | + /// <returns></returns> |
| 50 | + public static ProfitTransaction Retrieve(string ptxnId) |
| 51 | + { |
| 52 | + var ptxn = Requestor.DoRequest(string.Format("{0}/{1}", BaseUrl, ptxnId), "GET"); |
| 53 | + return Mapper<ProfitTransaction>.MapFromJson(ptxn); |
| 54 | + } |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// 分账明细列表查询 |
| 58 | + /// </summary> |
| 59 | + /// <param name="listParams"></param> |
| 60 | + /// <returns></returns> |
| 61 | + public static ProfitTransactionList List(Dictionary<string, object> listParams) |
| 62 | + { |
| 63 | + var ptxns = Requestor.DoRequest(Requestor.FormatUrl(BaseUrl, Requestor.CreateQuery(listParams)), "GET"); |
| 64 | + return Mapper<ProfitTransactionList>.MapFromJson(ptxns); |
| 65 | + } |
| 66 | + } |
| 67 | +} |
0 commit comments