2

Got Stripe up and running quickly and setup my form to include Billing address. But can't seem to find any way to store it in stripe, using the .net sdk.
If I go to stripe dashboard I can manually put in the billing address for a customer.

My working code looks like the following:

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);

I would expect there was an option on the StripeCustomerCreateOptions to include billing information.

I get the billing information in form post request.

  • Edit

After looking further into it. I can see that the Credit card has the information about address. But that is not desired.
I would like the receipt to have the billing address.
The only way I have gotten that to work is to update the customer manually from the dashboard.

Kiksen
  • 1,559
  • 1
  • 18
  • 41

2 Answers2

3

For Version 21.7.0 Here passing Billing address is changed like below code

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
          }
     }
};
Chirag
  • 76
  • 3
2

Found out after talking to support I had to set the shipping address, to get the billing address on their backend....

            var stripeCustomerCreateOptions = new StripeCustomerCreateOptions
            {
                Email = stripeEmail,
                SourceToken = stripeToken,
                Shipping = new StripeShippingOptions()
                {
                    Name = stripeBillingName,
                    Line1 = stripeBillingAddressLine1,
                    PostalCode = stripeBillingAddressZip,
                    State = stripeBillingAddressState,
                    CityOrTown = stripeBillingAddressCity,
                    Country = stripeBillingAddressCountry
                }
            };
Kiksen
  • 1,559
  • 1
  • 18
  • 41
  • 2
    Thanks, this isn't intuitive at all. I spent too long going through the documentation looking for billing address. – Ally Murray Jul 18 '18 at 12:15