Ejemplo n.º 1
0
        public CreditNoteServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new CreditNoteService(this.StripeClient);

            this.createOptions = new CreditNoteCreateOptions
            {
                Amount  = 100,
                Invoice = "in_123",
                Reason  = "duplicate",
            };

            this.updateOptions = new CreditNoteUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new CreditNoteListOptions
            {
                Limit   = 1,
                Invoice = "in_123",
            };

            this.listLineItemsOptions = new CreditNoteListLineItemsOptions
            {
                Limit = 1,
            };

            this.previewOptions = new CreditNotePreviewOptions
            {
                Amount  = 1000,
                Invoice = "in_123",
            };

            this.listPreviewLineItemsOptions = new CreditNoteListPreviewLineItemsOptions
            {
                Amount  = 1000,
                Invoice = "in_123",
            };

            this.voidOptions = new CreditNoteVoidOptions
            {
            };
        }
Ejemplo n.º 2
0
 public virtual IEnumerable <CreditNoteLineItem> ListLineItemsAutoPaging(string creditnoteId, CreditNoteListLineItemsOptions options = null, RequestOptions requestOptions = null)
 {
     return(this.ListRequestAutoPaging <CreditNoteLineItem>($"{this.InstanceUrl(creditnoteId)}/lines", options, requestOptions));
 }
Ejemplo n.º 3
0
 public virtual StripeList <CreditNoteLineItem> ListLineItems(string creditnoteId, CreditNoteListLineItemsOptions options = null, RequestOptions requestOptions = null)
 {
     return(this.Request <StripeList <CreditNoteLineItem> >(HttpMethod.Get, $"{this.InstanceUrl(creditnoteId)}/lines", options, requestOptions));
 }
Ejemplo n.º 4
0
 public virtual Task <StripeList <CreditNoteLineItem> > ListLineItemsAsync(string creditnoteId, CreditNoteListLineItemsOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(this.RequestAsync <StripeList <CreditNoteLineItem> >(HttpMethod.Get, $"{this.InstanceUrl(creditnoteId)}/lines", options, requestOptions, cancellationToken));
 }
Ejemplo n.º 5
0
 public virtual IAsyncEnumerable <CreditNoteLineItem> ListLineItemsAutoPagingAsync(string creditnoteId, CreditNoteListLineItemsOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
 {
     return(this.ListRequestAutoPagingAsync <CreditNoteLineItem>($"{this.InstanceUrl(creditnoteId)}/lines", options, requestOptions, cancellationToken));
 }