Пример #1
0
        public virtual async Task<StripeInvoice> UpcomingAsync(string customerId, StripeUpcomingInvoiceOptions upcomingOptions = null, StripeRequestOptions requestOptions = null)
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming", "customer", customerId);

            return Mapper<StripeInvoice>.MapFromJson(
                await Requestor.GetStringAsync(this.ApplyAllParameters(upcomingOptions, url, false),
                SetupRequestOptions(requestOptions))
            );
        }
        public virtual async Task <StripeInvoice> UpcomingAsync(string customerId, StripeUpcomingInvoiceOptions upcomingOptions = null, StripeRequestOptions requestOptions = null)
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming", "customer", customerId);

            return(Mapper <StripeInvoice> .MapFromJson(
                       await Requestor.GetStringAsync(this.ApplyAllParameters(upcomingOptions, url, false),
                                                      SetupRequestOptions(requestOptions))
                       ));
        }
        public virtual IEnumerable<StripeInvoiceLineItem> ListUpcomingLineItems(string customerId, StripeUpcomingInvoiceOptions listOptions = null, StripeRequestOptions requestOptions = null)
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming/lines", "customer", customerId);

            return Mapper<StripeInvoiceLineItem>.MapCollectionFromJson(
                Requestor.GetString(this.ApplyAllParameters(listOptions, url, true),
                SetupRequestOptions(requestOptions))
            );
        }
        public virtual async Task <StripeInvoice> UpcomingAsync(string customerId, StripeUpcomingInvoiceOptions upcomingOptions = null, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming", "customer", customerId);

            return(Mapper <StripeInvoice> .MapFromJson(
                       await Requestor.GetStringAsync(
                           this.ApplyAllParameters(upcomingOptions, url, false),
                           this.SetupRequestOptions(requestOptions),
                           cancellationToken).ConfigureAwait(false)));
        }
Пример #5
0
        public virtual StripeInvoice Upcoming( string customerId, StripeUpcomingInvoiceOptions options )
        {
           var url = string.Format( "{0}/{1}", Urls.Invoices, "upcoming" );

           url = ParameterBuilder.ApplyParameterToUrl( url, "customer", customerId );
           url = this.ApplyAllParameters( options, url, false );

           var response = Requestor.GetString( url, ApiKey );

           return Mapper<StripeInvoice>.MapFromJson( response );
        }
Пример #6
0
        public virtual StripeInvoice Upcoming(string customerId, StripeUpcomingInvoiceOptions upcomingOptions = null, StripeRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            var url = string.Format("{0}/{1}", Urls.Invoices, "upcoming");

            url = ParameterBuilder.ApplyParameterToUrl(url, "customer", customerId);
            url = this.ApplyAllParameters(upcomingOptions, url, false);

            var response = Requestor.GetString(url, requestOptions);

            return(Mapper <StripeInvoice> .MapFromJson(response));
        }
Пример #7
0
        public virtual StripeList <StripeInvoiceLineItem> ListUpcomingLineItems(string customerId, StripeUpcomingInvoiceOptions listOptions = null, StripeRequestOptions requestOptions = null)
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming/lines", "customer", customerId);

            return(Mapper <StripeList <StripeInvoiceLineItem> > .MapFromJson(
                       Requestor.GetString(this.ApplyAllParameters(listOptions, url, true),
                                           SetupRequestOptions(requestOptions))
                       ));
        }
Пример #8
0
        public virtual async Task <StripeList <StripeInvoiceLineItem> > ListUpcomingLineItemsAsync(string customerId, StripeUpcomingInvoiceOptions listOptions = null, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming/lines", "customer", customerId);

            return(Mapper <StripeList <StripeInvoiceLineItem> > .MapFromJson(
                       await Requestor.GetStringAsync(this.ApplyAllParameters(listOptions, url, true),
                                                      SetupRequestOptions(requestOptions),
                                                      cancellationToken)
                       ));
        }
        public virtual async Task<IEnumerable<StripeInvoiceLineItem>> ListUpcomingLineItemsAsync(string customerId, StripeUpcomingInvoiceOptions listOptions = null, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var url = ParameterBuilder.ApplyParameterToUrl($"{Urls.Invoices}/upcoming/lines", "customer", customerId);

            return Mapper<StripeInvoiceLineItem>.MapCollectionFromJson(
                await Requestor.GetStringAsync(this.ApplyAllParameters(listOptions, url, true),
                SetupRequestOptions(requestOptions),
                cancellationToken)
            );
        }