mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
expand sources and tax_ids for stripe api 2020-08-27 (#2199)
This commit is contained in:
parent
4b144f4cda
commit
13d1e74d69
@ -549,7 +549,8 @@ namespace Bit.Core.Services
|
||||
|
||||
var bankService = new BankAccountService();
|
||||
var customerService = new CustomerService();
|
||||
var customer = await customerService.GetAsync(organization.GatewayCustomerId);
|
||||
var customer = await customerService.GetAsync(organization.GatewayCustomerId,
|
||||
new CustomerGetOptions { Expand = new List<string> { "sources" } });
|
||||
if (customer == null)
|
||||
{
|
||||
throw new GatewayException("Cannot find customer.");
|
||||
|
@ -1345,6 +1345,7 @@ namespace Bit.Core.Services
|
||||
City = taxInfo.BillingAddressCity,
|
||||
State = taxInfo.BillingAddressState,
|
||||
},
|
||||
Expand = new List<string> { "sources" },
|
||||
});
|
||||
|
||||
subscriber.Gateway = GatewayType.Stripe;
|
||||
@ -1539,7 +1540,8 @@ namespace Bit.Core.Services
|
||||
return null;
|
||||
}
|
||||
|
||||
var customer = await _stripeAdapter.CustomerGetAsync(subscriber.GatewayCustomerId);
|
||||
var customer = await _stripeAdapter.CustomerGetAsync(subscriber.GatewayCustomerId,
|
||||
new Stripe.CustomerGetOptions { Expand = new List<string> { "tax_ids" } });
|
||||
|
||||
if (customer == null)
|
||||
{
|
||||
@ -1583,6 +1585,7 @@ namespace Bit.Core.Services
|
||||
PostalCode = taxInfo.BillingAddressPostalCode,
|
||||
Country = taxInfo.BillingAddressCountry,
|
||||
},
|
||||
Expand = new List<string> { "tax_ids" }
|
||||
});
|
||||
|
||||
if (!subscriber.IsUser() && customer != null)
|
||||
|
Loading…
Reference in New Issue
Block a user