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:
parent
ee2d7df061
commit
0de108e051
@ -352,12 +352,10 @@ public class ProviderBillingService(
|
|||||||
throw new BadRequestException("billingTaxIdTypeInferenceError");
|
throw new BadRequestException("billingTaxIdTypeInferenceError");
|
||||||
}
|
}
|
||||||
|
|
||||||
customerCreateOptions.TaxIdData = taxInfo.HasTaxId
|
customerCreateOptions.TaxIdData =
|
||||||
?
|
|
||||||
[
|
[
|
||||||
new CustomerTaxIdDataOptions { Type = taxIdType, Value = taxInfo.TaxIdNumber }
|
new CustomerTaxIdDataOptions { Type = taxIdType, Value = taxInfo.TaxIdNumber }
|
||||||
]
|
];
|
||||||
: null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -11,10 +11,4 @@ public class TaxInfo
|
|||||||
public string BillingAddressState { get; set; }
|
public string BillingAddressState { get; set; }
|
||||||
public string BillingAddressPostalCode { get; set; }
|
public string BillingAddressPostalCode { get; set; }
|
||||||
public string BillingAddressCountry { get; set; } = "US";
|
public string BillingAddressCountry { get; set; } = "US";
|
||||||
|
|
||||||
public bool HasTaxId
|
|
||||||
{
|
|
||||||
get => !string.IsNullOrWhiteSpace(TaxIdNumber) &&
|
|
||||||
!string.IsNullOrWhiteSpace(TaxIdType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ public class StripePaymentService : IPaymentService
|
|||||||
City = taxInfo?.BillingAddressCity,
|
City = taxInfo?.BillingAddressCity,
|
||||||
State = taxInfo?.BillingAddressState,
|
State = taxInfo?.BillingAddressState,
|
||||||
},
|
},
|
||||||
TaxIdData = taxInfo.HasTaxId
|
TaxIdData = !string.IsNullOrWhiteSpace(taxInfo.TaxIdNumber)
|
||||||
? [new CustomerTaxIdDataOptions { Type = taxInfo.TaxIdType, Value = taxInfo.TaxIdNumber }]
|
? [new CustomerTaxIdDataOptions { Type = taxInfo.TaxIdType, Value = taxInfo.TaxIdNumber }]
|
||||||
: null
|
: null
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user