Beispiel #1
0
        public transfers_fixture()
        {
            var transferGroup = $"test_group_{ Guid.NewGuid() }";

            // make sure the account has sufficient funds first
            var chargeService = new StripeChargeService(Cache.ApiKey);

            Charge = chargeService.Create(new StripeChargeCreateOptions
            {
                Amount     = 10000,
                Currency   = "usd",
                SourceCard = new SourceCard
                {
                    Number          = "4000000000000077",
                    ExpirationMonth = 10,
                    ExpirationYear  = 2021,
                    Cvc             = "123"
                },
                TransferGroup = transferGroup
            });

            TransferCreateOptions = new StripeTransferCreateOptions
            {
                Amount            = 1000,
                Currency          = "usd",
                Destination       = Cache.GetAccount().Id,
                TransferGroup     = transferGroup,
                SourceTransaction = Charge.Id
            };

            TransferUpdateOptions = new StripeTransferUpdateOptions
            {
                Metadata = new Dictionary <string, string>()
                {
                    { "some-key", "some-value" }
                }
            };

            var service = new StripeTransferService(Cache.ApiKey);

            Transfer          = service.Create(TransferCreateOptions);
            TransferUpdated   = service.Update(Transfer.Id, TransferUpdateOptions);
            TransferRetrieved = service.Get(Transfer.Id);

            TransferListOptions = new StripeTransferListOptions
            {
                Created = new StripeDateFilter {
                    EqualTo = Transfer.Created
                }
            };

            TransferList = service.List(TransferListOptions);
        }
Beispiel #2
0
        public transfers_fixture()
        {
            // make sure the account has sufficient funds first
            new StripeChargeService(Cache.ApiKey).Create(new StripeChargeCreateOptions
            {
                Amount     = 10000,
                Currency   = "usd",
                SourceCard = new SourceCard
                {
                    Number          = "4000000000000077",
                    ExpirationMonth = "10",
                    ExpirationYear  = "2019",
                    Cvc             = "123"
                }
            });

            TransferCreateOptions = new StripeTransferCreateOptions
            {
                Amount      = 1000,
                Currency    = "usd",
                Destination = Cache.GetAccount().Id
            };

            TransferUpdateOptions = new StripeTransferUpdateOptions
            {
                Metadata = new Dictionary <string, string>()
                {
                    { "some-key", "some-value" }
                }
            };

            var service = new StripeTransferService(Cache.ApiKey);

            Transfer          = service.Create(TransferCreateOptions);
            TransferUpdated   = service.Update(Transfer.Id, TransferUpdateOptions);
            TransferRetrieved = service.Get(Transfer.Id);

            TransferListOptions = new StripeTransferListOptions
            {
                Created = new StripeDateFilter {
                    EqualTo = Transfer.Created
                }
            };

            TransferList = service.List(TransferListOptions).ToList();
        }