Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public Invoice(Invoice obj)
     : base(obj)
 {
 }
Exemplo n.º 3
0
 public static Invoice Create(Invoice invoice, string apiKey)
 {
     return BaseCreate(invoice, apiKey);
 }
Exemplo n.º 4
0
 public static Invoice Delete(string id, string apiKey)
 {
     var inv = new Invoice { Id = id, ApiKey = apiKey };
     inv.Delete();
     return inv;
 }
Exemplo n.º 5
0
 public static Invoice Create(Invoice invoice)
 {
     return BaseCreate(invoice, null);
 }