Exemple #1
0
 public static UObject FromJObject(JObject obj)
 {
     if (obj == null)
         return null;
     if (obj["object"] == null || obj["id"] == null)
         return null;
     var objType = obj["object"].Value<string>();
     switch (objType)
     {
         case "account":
             var account = new Account();
             account.FromObject(obj);
             return account;
         case "connection":
             var connection = new Connection();
             connection.FromObject(obj);
             return connection;
         case "event":
             var evt = new Event();
             evt.FromObject(obj);
             return evt;
         case "invoice":
             var invoice = new Invoice();
             invoice.FromObject(obj);
             return invoice;
         case "payment":
             var payment = new Payment();
             payment.FromObject(obj);
             return payment;
     }
     return null;
 }
Exemple #2
0
 public Payment(Payment obj)
     : base(obj)
 {
 }
Exemple #3
0
 public static Payment Create(Payment payment)
 {
     return BaseCreate(payment, null);
 }
Exemple #4
0
 public static Payment Create(Payment payment, string apiKey)
 {
     return BaseCreate(payment, apiKey);
 }
Exemple #5
0
 public static Payment Cancel(string id, string apiKey)
 {
     var payment = new Payment { Id = id, ApiKey = apiKey };
     payment.Cancel();
     return payment;
 }