AccountCreateOptions后如何获取Account对象

问题描述 投票:0回答:1

我有成功的代码:

        StripeConfiguration.ApiKey = "xxxx";
    var options = new AccountCreateOptions
    {
        Country = data.country,
        Email = data.businessEmail,
        BusinessType = "individual",
        Capabilities = new AccountCapabilitiesOptions()
        {
            CardPayments = new AccountCapabilitiesCardPaymentsOptions(){ Requested = true },
            Transfers = new AccountCapabilitiesTransfersOptions { Requested = true },
        },
        Controller = new AccountControllerOptions
        {
            Fees = new AccountControllerFeesOptions { Payer = "account" },
            Losses = new AccountControllerLossesOptions { Payments = "stripe" },
            StripeDashboard = new AccountControllerStripeDashboardOptions
            {
                Type = "full",
            },
            RequirementCollection = "stripe"
        },
    };
    var service = new AccountService();
    service.Create(options);

stripe api 说我应该收到这样的响应对象:

{
"id": "acct_1Nv0FGQ9RKHgCVdK",
"object": "account",
"business_profile": {
"annual_revenue": null,
"estimated_worker_count": null,
"mcc": null,
"name": null,
"product_description": null,
"support_address": null,
"support_email": null,
"support_phone": null,
......

我正在查看 AccountService 对象:

var service = new AccountService();

但我似乎无法用示例的 id 取回响应对象,以便我可以获得开始入职流程的 url:

acct_1Nv0FGQ9RKHgCVdK

如何在 Stripe.net 中执行此操作?

我从 AccountService 获取此信息:

enter image description here

c# .net stripe-payments
1个回答
0
投票

我必须使用 service.CreateAsync()

var responseObject = await service.CreateAsync(options);
© www.soinside.com 2019 - 2024. All rights reserved.