コード例 #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);
        }
コード例 #2
0
 public InvoiceEmailWrapper()
 {
     invoice = new InvoiceEmail();
 }
コード例 #3
0
 internal static InvoiceEmailWrapper Wrap(this InvoiceEmail email)
 {
     return(new InvoiceEmailWrapper {
         Invoice = email
     });
 }
コード例 #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())));
 }
コード例 #5
0
ファイル: Invoices.cs プロジェクト: JamesDawson/FreeAgent
 public InvoiceEmailWrapper()
 {
     invoice = new InvoiceEmail ();
 }