1
0
mirror of https://github.com/bitwarden/server.git synced 2025-03-02 04:11:04 +01:00

[PM-16682] Fix tax id not being saved for providers (#5257)

This commit is contained in:
Jonas Hendrickx 2025-01-20 16:50:11 +01:00 committed by GitHub
parent ee2d7df061
commit 0de108e051
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 13 deletions

View File

@ -352,12 +352,10 @@ public class ProviderBillingService(
throw new BadRequestException("billingTaxIdTypeInferenceError");
}
customerCreateOptions.TaxIdData = taxInfo.HasTaxId
?
[
new CustomerTaxIdDataOptions { Type = taxIdType, Value = taxInfo.TaxIdNumber }
]
: null;
customerCreateOptions.TaxIdData =
[
new CustomerTaxIdDataOptions { Type = taxIdType, Value = taxInfo.TaxIdNumber }
];
}
try

View File

@ -11,10 +11,4 @@ public class TaxInfo
public string BillingAddressState { get; set; }
public string BillingAddressPostalCode { get; set; }
public string BillingAddressCountry { get; set; } = "US";
public bool HasTaxId
{
get => !string.IsNullOrWhiteSpace(TaxIdNumber) &&
!string.IsNullOrWhiteSpace(TaxIdType);
}
}

View File

@ -167,7 +167,7 @@ public class StripePaymentService : IPaymentService
City = taxInfo?.BillingAddressCity,
State = taxInfo?.BillingAddressState,
},
TaxIdData = taxInfo.HasTaxId
TaxIdData = !string.IsNullOrWhiteSpace(taxInfo.TaxIdNumber)
? [new CustomerTaxIdDataOptions { Type = taxInfo.TaxIdType, Value = taxInfo.TaxIdNumber }]
: null
};