【问题标题】:Stripe Billing Address C# / Dotnet core条带帐单地址 C#/Dotnet 核心
【发布时间】:2019-03-20 17:35:22
【问题描述】:

让 Stripe 快速启动并运行,并设置我的表单以包含账单地址。但似乎找不到任何方法将其存储在条带中,使用 .net sdk。
如果我转到条带仪表板,我可以手动输入客户的帐单地址。

我的工作代码如下所示:

var stripeCustomerCreateOptions = new StripeCustomerCreateOptions
{
    Email = value.StripeEmail,
    SourceToken = value.StripeToken,
};

var stripeCustomerService = new StripeCustomerService();
StripeCustomer customer = stripeCustomerService.Create(stripeCustomerCreateOptions);

var stripeSubscriptionService = new StripeSubscriptionService();
var subscription = stripeSubscriptionService.Create(customer.Id, _stripePlanId);

我希望StripeCustomerCreateOptions 上有一个选项可以包含帐单信息。

我在表单发布请求中获得了账单信息。

  • 编辑

在深入研究之后。我可以看到信用卡有关于地址的信息。但这不是我们所希望的。
我希望收据上有帐单地址。
我让它工作的唯一方法是从仪表板手动更新客户。

【问题讨论】:

    标签: .net-core stripe-payments stripe.net


    【解决方案1】:

    对于版本 21.7.0 这里通过帐单地址更改如下代码

    var options = new CustomerCreateOptions
    {
         Email = stripeEmail,
         SourceToken = stripeToken,
         Shipping = new ShippingOptions()
         {
              Name = LoginUser.FirstName + " " + LoginUser.LastName,
              Phone = LoginUser.Mobile,
              Address = new AddressOptions()
              {
                  Line1 = LoginUser.Address,
                  PostalCode = LoginUser.ZipCode,
                  State = LoginUser.State,
                  City = LoginUser.City,
                  Country = LoginUser.Country
              }
         }
    };
    

    【讨论】:

      【解决方案2】:

      与支持人员交谈后发现,我必须设置送货地址,才能在他们的后端获取账单地址....

                  var stripeCustomerCreateOptions = new StripeCustomerCreateOptions
                  {
                      Email = stripeEmail,
                      SourceToken = stripeToken,
                      Shipping = new StripeShippingOptions()
                      {
                          Name = stripeBillingName,
                          Line1 = stripeBillingAddressLine1,
                          PostalCode = stripeBillingAddressZip,
                          State = stripeBillingAddressState,
                          CityOrTown = stripeBillingAddressCity,
                          Country = stripeBillingAddressCountry
                      }
                  };
      

      【讨论】:

      • 谢谢,这根本不直观。我花了太长时间浏览文档以查找帐单地址。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-22
      • 2020-01-03
      • 1970-01-01
      • 2013-10-09
      相关资源
      最近更新 更多