1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

[AC 480]Add the organization name to the stripe invoice (#2772)

* Adding organization name on subscription and update

* Changes after running  dotnet format -v diag

* Change the OrganizationName to GetName

* Change GetName to OwnerName

* Change the OwnerName to SubscriberName

* Reverting the changes made by dotnet format-v diag

* Removing extract space

* resolve the lint issue

* Fix whitespace formatting issue

* Resolving pr comment on changing organization

* Fixing the failing test

* Using the ISubscriber interface for consistent

* fixing the whitescapes

* Resolving the PR comments

* resolving the whitespace format

* Remove unnecessary directive

* Resolving the whitespace issue

* changes for organization instead of subscriber

* resolving the failing test

* Resolve lint issue by removing unnecessary directive

* Resolve the PR comment

* remove these blank lines

* Fixing whitespace formatting
This commit is contained in:
cyprain-okeke
2023-04-07 10:45:18 +01:00
committed by GitHub
parent 53b9d52125
commit 6d7bcd98a9
5 changed files with 68 additions and 4 deletions

View File

@ -124,8 +124,17 @@ public class StripePaymentService : IPaymentService
Metadata = stripeCustomerMetadata,
InvoiceSettings = new Stripe.CustomerInvoiceSettingsOptions
{
DefaultPaymentMethod = stipeCustomerPaymentMethodId
DefaultPaymentMethod = stipeCustomerPaymentMethodId,
CustomFields = new List<Stripe.CustomerInvoiceSettingsCustomFieldOptions>
{
new Stripe.CustomerInvoiceSettingsCustomFieldOptions()
{
Name = org.SubscriberType(),
Value = org.SubscriberName(),
},
},
},
Address = new Stripe.AddressOptions
{
Country = taxInfo.BillingAddressCountry,
@ -427,7 +436,15 @@ public class StripePaymentService : IPaymentService
Source = stipeCustomerSourceToken,
InvoiceSettings = new Stripe.CustomerInvoiceSettingsOptions
{
DefaultPaymentMethod = stipeCustomerPaymentMethodId
DefaultPaymentMethod = stipeCustomerPaymentMethodId,
CustomFields = new List<Stripe.CustomerInvoiceSettingsCustomFieldOptions>
{
new Stripe.CustomerInvoiceSettingsCustomFieldOptions()
{
Name = user.SubscriberType(),
Value = user.SubscriberName(),
},
}
},
Address = new Stripe.AddressOptions
{
@ -1334,7 +1351,15 @@ public class StripePaymentService : IPaymentService
PaymentMethod = stipeCustomerPaymentMethodId,
InvoiceSettings = new Stripe.CustomerInvoiceSettingsOptions
{
DefaultPaymentMethod = stipeCustomerPaymentMethodId
DefaultPaymentMethod = stipeCustomerPaymentMethodId,
CustomFields = new List<Stripe.CustomerInvoiceSettingsCustomFieldOptions>
{
new Stripe.CustomerInvoiceSettingsCustomFieldOptions()
{
Name = subscriber.SubscriberType(),
Value = subscriber.SubscriberName(),
},
}
},
Address = taxInfo == null ? null : new Stripe.AddressOptions
{
@ -1406,7 +1431,15 @@ public class StripePaymentService : IPaymentService
DefaultSource = defaultSourceId,
InvoiceSettings = new Stripe.CustomerInvoiceSettingsOptions
{
DefaultPaymentMethod = defaultPaymentMethodId
DefaultPaymentMethod = defaultPaymentMethodId,
CustomFields = new List<Stripe.CustomerInvoiceSettingsCustomFieldOptions>
{
new Stripe.CustomerInvoiceSettingsCustomFieldOptions()
{
Name = subscriber.SubscriberType(),
Value = subscriber.SubscriberName(),
},
}
},
Address = taxInfo == null ? null : new Stripe.AddressOptions
{