Пример #1
0
        /// <summary>
        /// Send an existing invoice to a list of recipients. Makes a POST request to the Invoices/Messages resource.
        /// </summary>
        /// <param name="invoiceId">The ID of the invoice to send</param>
        /// <param name="options">The options of the message to send</param>
        public InvoiceMessage SendInvoice(long invoiceId, InvoiceMessageOptions options)
        {
            var request = Request("invoices/" + invoiceId + "/messages", RestSharp.Method.POST);

            request.AddBody(options);

            return Execute<InvoiceMessage>(request);
        }
Пример #2
0
        /// <summary>
        /// Send an existing invoice to a list of recipients. Makes a POST request to the Invoices/Messages resource.
        /// </summary>
        /// <param name="invoiceId">The ID of the invoice to send</param>
        /// <param name="recipients">The email addresses of the recipients</param>
        /// <param name="body">The body of the message</param>
        /// <param name="sendMeACopy">Whether to send a copy of the invoice to the authenticated user</param>
        /// <param name="attachPdf">Whether to attach a pdf copy of the invoice to the email(s)</param>
        public InvoiceMessage SendInvoice(long invoiceId, string recipients, string body = null, bool sendMeACopy = true, bool attachPdf = true, bool includeLink = false)
        {
            var options = new InvoiceMessageOptions()
            {
                Recipients = recipients,
                Body = body,
                SendMeACopy = sendMeACopy,
                AttachPdf = attachPdf,
                IncludePayPalLink = includeLink
            };

            return SendInvoice(invoiceId, options);
        }
Пример #3
0
        private bool _createInvoiceMessageAction(long invoiceId, string body, string action)
        {
            var request = Request("invoices/" + invoiceId + "/messages/" + action, RestSharp.Method.POST);

            var options = new InvoiceMessageOptions()
            {
                Body = body
            };

            request.AddBody(options);

            var result = Execute(request);

            return result.StatusCode == System.Net.HttpStatusCode.OK;
        }