Ejemplo n.º 1
0
        public bool SendEmail(string invoiceId, InvoiceEmail email)
        {
            var request = CreateBasicRequest(Method.POST, "/{id}/send_email");

            request.RequestFormat = DataFormat.Json;

            request.AddUrlSegment("id", invoiceId);
            request.AddBody(new InvoiceEmailWrapper()
            {
                invoice = email
            });


            var response = Client.Execute(request);

            if (response != null)
            {
                return(response.StatusCode == System.Net.HttpStatusCode.OK);
            }

            return(false);
        }
Ejemplo n.º 2
0
 public InvoiceEmailWrapper()
 {
     invoice = new InvoiceEmail();
 }
Ejemplo n.º 3
0
 internal static InvoiceEmailWrapper Wrap(this InvoiceEmail email)
 {
     return(new InvoiceEmailWrapper {
         Invoice = email
     });
 }
Ejemplo n.º 4
0
 public static Task CreateInvoiceEmail(this FreeAgentClient client, int invoiceId, InvoiceEmail email)
 {
     return(client.Execute(c => c.EmailInvoice(client.Configuration.CurrentHeader, invoiceId, email.Wrap())));
 }
Ejemplo n.º 5
0
 public InvoiceEmailWrapper()
 {
     invoice = new InvoiceEmail ();
 }