【发布时间】:2019-03-13 17:13:50
【问题描述】:
我有一个关于如何为我的系统/平台实施适当支付的问题。
让我进一步解释一下。我有一个像 Lyft 这样的平台,但不是在每次乘车后立即创建和发出费用。我正在创建发票项目,以便每个发票结算周期(例如每 2 周)只向骑手收取一次费用。现在,我知道使用 Stripe 的发票或发票项目没有目的地 ID。所以我需要以某种方式告诉 Stripe 需要哪些资金给司机。我怎么做?似乎该方法是创建一个Stripe payout,并将目的地作为驱动程序的银行帐户ID。但在使用驱动程序外部帐户 ID 和银行帐户 ID 尝试此操作后,Stripe 抛出异常说“不存在此类外部帐户 acct_123456ABCD”
我上面描述的方法是实现这个的正确方法吗?还是有更好的方法或更规范的方法?
仅供参考 - 要了解我为什么要创建发票项目,而不是在乘车后立即收费,这是因为我的服务费用都非常小(1.00 美元到 3.00 美元),所以要避免 Stripe 固定费用 $ .30/charge 我将它们汇总到一张发票中,每个账单周期只有一笔固定费用。
感谢您的帮助。
出于前面的目的,我将在下面包含一个我正在做的事情的示例。 首先我创建一个发票项目,然后创建一个付款。
var invoiceItemOptions = new StripeInvoiceItemCreateOptions()
{
Amount = tipPricing.GetTotalAmountCharged(),
Currency = "USD", //defaultCard.CurrencyCode,
CustomerId = '12334567',
Metadata = new Dictionary<String, String>() { { "EventId", 123 } }
};
var invoiceItemService = new StripeInvoiceItemService();
StripeInvoiceLineItem invoiceItem = invoiceItemService.Create(invoiceItemOptions);
StripeResponse invoiceResponse = invoiceItem.StripeResponse;
////////////////////////////////////////////////////////////////////////
var payoutOptions = new StripePayoutCreateOptions()
{
Amount = tipPricing.GetTotalDestinationAmount(hasBeenChargedThisMonth),
Currency = "USD",
Destination = bankAccount.ExternalAccountId, //bankAccount.AccountId,
Metadata = new Dictionary<String, String>() { { "EventId", 123 } }
};
var payoutService = new StripePayoutService();
StripePayout payoutCharge = payoutService.Create(payoutOptions);
StripeResponse payoutResponse = payoutCharge.StripeResponse;
【问题讨论】:
标签: c# stripe-payments