public void TransferToRecipient(string recipId, string description, int centsAmount)
        {
            var myTransfer = new StripeTransferCreateOptions();

            myTransfer.Amount      = centsAmount;
            myTransfer.Currency    = "usd";
            myTransfer.Recipient   = recipId;        // can also be "self" if you want to send to your own account
            myTransfer.Description = description;    // optional

            var transferService = new StripeTransferService(Constants.StripeSecretKey);
            var stripeTransfer  = transferService.Create(myTransfer);
        }
Esempio n. 2
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);
        }
		public static StripeTransferCreateOptions Valid()
		{
			var stripeTransferCreateOptions = new StripeTransferCreateOptions()
			{
				AmountInCents = 50,
				Currency = "usd",
				Recipient = "self",
				Description = "test-transfer-description-" + Guid.NewGuid().ToString(),
				StatementDescriptor = "test-transfer-statement-descriptor" + Guid.NewGuid().ToString()
			};

			return stripeTransferCreateOptions;
		}
Esempio n. 4
0
        public StripeTransfer CreateTransfer(Reimbursement reimbursement)
        {
            StripeConfiguration.SetApiKey(_stripe_key);
            var options = new StripeTransferCreateOptions
            {
                // TODO
            };

            var            service  = new StripeTransferService();
            StripeTransfer transfer = service.Create(options);

            return(transfer);
        }
Esempio n. 5
0
        public static StripeTransferCreateOptions Valid()
        {
            var stripeTransferCreateOptions = new StripeTransferCreateOptions()
            {
                AmountInCents       = 50,
                Currency            = "usd",
                Recipient           = "self",
                Description         = "test-transfer-description-" + Guid.NewGuid().ToString(),
                StatementDescriptor = "test-transfer-statement-descriptor" + Guid.NewGuid().ToString()
            };

            return(stripeTransferCreateOptions);
        }
Esempio n. 6
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();
        }
        public static StripeTransferCreateOptions Valid(string recipient = "self")
        {
            var stripeTransferCreateOptions = new StripeTransferCreateOptions()
            {
                Amount = 50,
                Currency = "usd",
                Recipient = recipient,
                Description = "test-transfer-description-" + Guid.NewGuid(),
                StatementDescriptor = "test-transfer-statement-descriptor" + Guid.NewGuid(),
                Metadata = new Dictionary<string, string>
                {
                    { "A", "Value-A" },
                    { "B", "Value-B" }
                }
            };

            return stripeTransferCreateOptions;
        }
        public static StripeTransferCreateOptions Valid(string recipient = "self")
        {
            var stripeTransferCreateOptions = new StripeTransferCreateOptions()
            {
                Amount              = 50,
                Currency            = "usd",
                Recipient           = recipient,
                Description         = "test-transfer-description-" + Guid.NewGuid(),
                StatementDescriptor = "test-transfer-statement-descriptor" + Guid.NewGuid(),
                Metadata            = new Dictionary <string, string>
                {
                    { "A", "Value-A" },
                    { "B", "Value-B" }
                }
            };

            return(stripeTransferCreateOptions);
        }
Esempio n. 9
0
        private static void TransferToProfessional(double priceService, AccountPayment accountStripe)
        {
            var valueIlevus = Math.Round(priceService, 2);
            // Faco a transferencia para o professional.
            var transferOptions = new StripeTransferCreateOptions()
            {
                Amount = Int32.Parse(valueIlevus.ToString()
                                     .Replace(",", string.Empty)
                                     .Replace(".", string.Empty)),
                Currency      = "brl",
                Destination   = accountStripe.Id,
                TransferGroup = "{ORDER10}",
            };

            var transferService = new StripeTransferService();

            transferService.Create(transferOptions);
        }
 public static string TranferPayment(int amount, string currency, string destination)
 {
     try
     {
         amount = amount * 100;
         string stripekey = ConfigurationManager.AppSettings["AdminStripeApiKey"];
         StripeConfiguration.SetApiKey(stripekey);
         var transferOptions = new StripeTransferCreateOptions()
         {
             Amount      = amount,
             Currency    = currency,
             Destination = destination
         };
         var transferService = new StripeTransferService();
         var stripeTransfer  = transferService.Create(transferOptions);
         return(stripeTransfer.Id);
     }
     catch (Exception ex)
     {
         Common.ExcepLog(ex);
         throw;
     }
 }
Esempio n. 11
0
        public StripeTransferServiceTest()
        {
            this.service = new StripeTransferService();

            this.createOptions = new StripeTransferCreateOptions()
            {
                Amount      = 123,
                Currency    = "usd",
                Destination = "acct_123",
            };

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

            this.listOptions = new StripeTransferListOptions()
            {
                Limit = 1,
            };
        }