Пример #1
0
        public transfer_reversals_fixture()
        {
            // make sure the account has sufficient funds first
            new StripeChargeService(Cache.ApiKey).Create(new StripeChargeCreateOptions
            {
                Amount   = 10000,
                Currency = "usd",
                SourceTokenOrExistingSourceId = "tok_bypassPending"
            });

            // create transfer to be reversed
            Transfer = new StripeTransferService(Cache.ApiKey).Create(new StripeTransferCreateOptions
            {
                Amount      = 1000,
                Currency    = "usd",
                Destination = Cache.GetAccount().Id
            });

            TransferReversalCreateOptions = new StripeTransferReversalCreateOptions
            {
                Amount      = 1000,
                Description = "Transfer reversed"
            };

            TransferReversalUpdateOptions = new StripeTransferReversalUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "some-key", "some-value" }
                }
            };

            TransferReversalListOptions = new StripeTransferReversalListOptions();

            var service = new StripeTransferReversalService(Cache.ApiKey);

            service.ExpandBalanceTransaction = true;
            service.ExpandTransfer           = true;

            TransferReversal          = service.Create(Transfer.Id, TransferReversalCreateOptions);
            TransferReversalUpdated   = service.Update(Transfer.Id, TransferReversal.Id, TransferReversalUpdateOptions);
            TransferReversalRetrieved = service.Get(Transfer.Id, TransferReversal.Id);
            TransferReversalList      = service.List(Transfer.Id, TransferReversalListOptions);

            // get the original transfer
            Transfer = new StripeTransferService(Cache.ApiKey).Get(Transfer.Id);
        }
        public StripeTransferReversalServiceTest()
        {
            this.service = new StripeTransferReversalService();

            this.createOptions = new StripeTransferReversalCreateOptions()
            {
                Amount = 123,
            };

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

            this.listOptions = new StripeTransferReversalListOptions()
            {
                Limit = 1,
            };
        }
 public virtual Task <StripeList <StripeTransferReversal> > ListAsync(string transferId, StripeTransferReversalListOptions options = null, StripeRequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(this.GetEntityListAsync($"{Urls.BaseUrl}/transfers/{transferId}/reversals", requestOptions, cancellationToken, options));
 }
 public virtual StripeList <StripeTransferReversal> List(string transferId, StripeTransferReversalListOptions options = null, StripeRequestOptions requestOptions = null)
 {
     return(this.GetEntityList($"{Urls.BaseUrl}/transfers/{transferId}/reversals", requestOptions, options));
 }