【问题标题】:Can I cache the portal configuration object for multiple customers?我可以为多个客户缓存门户配置对象吗?
【发布时间】:2022-11-02 15:14:16
【问题描述】:

Stripe 文档here 描述了如何创建客户门户配置。

这是示例代码的样子:

StripeConfiguration.ApiKey = "....";

var options = new ConfigurationCreateOptions
{
    BusinessProfile = new ConfigurationBusinessProfileOptions
    {
        Headline = "Cactus Practice partners with Stripe for simplified billing.",
    },
    Features = new ConfigurationFeaturesOptions
    {
        InvoiceHistory = new ConfigurationFeaturesInvoiceHistoryOptions
        {
            Enabled = true,
        },
    },
};
var service = new ConfigurationService();
await service.CreateAsync(options);

每次我想为我的客户生成客户门户会话时,我都不想点击 Stripe API 来创建新配置。

所以我的问题是,我可以缓存配置服务器端并为所有客户使用相同的客户门户配置吗?

还是对配置有某种到期或限制?

【问题讨论】:

    标签: .net caching stripe-payments stripe-customer-portal


    【解决方案1】:

    是的,应该可以为每个客户缓存客户门户配置

    【讨论】:

      【解决方案2】:

      Stripe 支持确认客户门户配置不会过期,因此我们可以使用存储 CustomerPortal.Configuration.ID 并将其用于多个客户。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-07
        • 1970-01-01
        • 2017-04-13
        • 1970-01-01
        • 1970-01-01
        • 2022-11-06
        • 2014-04-09
        • 2014-02-12
        相关资源
        最近更新 更多