Ejemplo n.º 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))
            );
        }
Ejemplo n.º 2
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 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)));
        }
Ejemplo n.º 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 );
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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))
                       ));
        }
Ejemplo n.º 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)
            );
        }