1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-06 02:22:49 -05:00

[AC-1223][AC-1184] Failed Renewals (#3158)

* 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
This commit is contained in:
Conner Turnbull
2023-08-28 09:56:50 -04:00
committed by GitHub
parent fae4d3ca1b
commit 8eee9b330d
4 changed files with 179 additions and 16 deletions

View File

@ -10,4 +10,5 @@ public static class HandledStripeWebhook
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";
}