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); }
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 StripeTransfer CreateTransfer(Reimbursement reimbursement) { StripeConfiguration.SetApiKey(_stripe_key); var options = new StripeTransferCreateOptions { // TODO }; var service = new StripeTransferService(); StripeTransfer transfer = service.Create(options); return(transfer); }
public transfer_reversals_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" } }); // 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" } } }; 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, new StripeListOptions()).ToList(); // get the original transfer Transfer = new StripeTransferService(Cache.ApiKey).Get(Transfer.Id); }
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 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(); }
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; } }
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, }; }