【问题标题】:Charging customer on behalf of shopkeeper using Stripe Connect?使用 Stripe Connect 代表店主向客户收费?
【发布时间】:2014-10-31 06:59:13
【问题描述】:

我正在使用 ASP.NET 开发它,并且我使用了 Stripe.NET dll,根据我已将我的 shopkeeper stripe 帐户与我关联并获得访问代码的文档。

现在我对我的客户感到困惑,应该将他添加为 shopkeeper 的 Stripe 帐户中的客户,或者只是将他的帐户作为 Shopkeepers 与我的 Stripe 帐户相关联。

谁能解释一下,它是如何工作的?

var stripeService = new StripeChargeService(sellerStore.StripeMerchantAccessToken); //The token returned from the above method
var stripeChargeOption = new StripeChargeCreateOptions() { 
AmountInCents = amountInCents,
Currency = "usd", 
CustomerId = buyerPaymentInfo.StripeCustomerToken,
Description = "Locabal",
ApplicationFeeInCents = locabalsCut 
};
var response = stripeService.Create(stripeChargeOption);

buyerPaymentInfo.StripeCustomerToken 将是访问代码还是在供应商帐户中注册的客户?

我想用他的信用卡向客户收费

我们将非常感谢您的帮助。

【问题讨论】:

    标签: c# asp.net stripe-payments stripe.net


    【解决方案1】:

    根据我对 Stripe API 的理解,您应该在您的帐户中创建一个客户,并在费用中使用以“cus_”开头的客户 ID。

    如果您查看以下 stripe.net 讨论,您将了解如何创建客户并将其用于您的管理。

    https://github.com/jaymedavis/stripe.net/pull/43#issuecomment-30345043

    //This is what we do to create a long-term customer in our system
    //user is a user object unique to our system. We save it in our database
    //stripeToken is what is generated by the Javascript on the page
    var stripeService = new stripeCustomerService(ConfigurationManager.AppSettings["StripeSecret"]);
    var stripeTokenOptions = new StripeCustomerCreateOptions { TokenId = stripeToken };
    var response = stripeService.Create(stripeTokenOptions);
    
    if (user.PaymentInfo == null)
    {
        PaymentInfo paymentInfo = new PaymentInfo
        {
            StripeCustomerToken = response.Id
        };
        user.PaymentInfo = paymentInfo;
    }
    else
    {
        user.PaymentInfo.StripeCustomerToken = response.Id;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-26
      • 1970-01-01
      • 2020-04-02
      • 2017-06-17
      • 1970-01-01
      相关资源
      最近更新 更多