mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00

* Added null checks when getting customer metadata * Added additional logging around paypal payments * Refactor region validation in StripeController * Update region retrieval method in StripeController Refactored the method GetCustomerRegionFromMetadata in StripeController. Previously, it returned null in case of nonexisting region key. Now, it checks all keys with case-insensitive comparison, and if no "region" key is found, it defaults to "US". This was done to handle cases where the region key might not be properly formatted or missing. * Updated switch expression to be switch statement * Updated new log to not log user input * Add handling for 'payment_method.attached' webhook * Cancelling unpaid premium subscriptions * Update hardcoded Stripe status strings to constants * Updated expand string to use snake_case * Removed unnecessary comments
15 lines
697 B
C#
15 lines
697 B
C#
namespace Bit.Billing.Constants;
|
|
|
|
public static class HandledStripeWebhook
|
|
{
|
|
public const string SubscriptionDeleted = "customer.subscription.deleted";
|
|
public const string SubscriptionUpdated = "customer.subscription.updated";
|
|
public const string UpcomingInvoice = "invoice.upcoming";
|
|
public const string ChargeSucceeded = "charge.succeeded";
|
|
public const string ChargeRefunded = "charge.refunded";
|
|
public const string PaymentSucceeded = "invoice.payment_succeeded";
|
|
public const string PaymentFailed = "invoice.payment_failed";
|
|
public const string InvoiceCreated = "invoice.created";
|
|
public const string PaymentMethodAttached = "payment_method.attached";
|
|
}
|