From f767722547e4aa2658e46ecf55400b454c7b63f8 Mon Sep 17 00:00:00 2001 From: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:32:53 -0500 Subject: [PATCH] Updated customer metadata when updating to use bank account (#5050) --- src/Core/Billing/Services/Implementations/SubscriberService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Billing/Services/Implementations/SubscriberService.cs b/src/Core/Billing/Services/Implementations/SubscriberService.cs index 401d9ce2caa9..b0d290a55613 100644 --- a/src/Core/Billing/Services/Implementations/SubscriberService.cs +++ b/src/Core/Billing/Services/Implementations/SubscriberService.cs @@ -768,8 +768,9 @@ private async Task RemoveBraintreeCustomerIdAsync( { var metadata = customer.Metadata ?? new Dictionary(); - if (metadata.ContainsKey(BraintreeCustomerIdKey)) + if (metadata.TryGetValue(BraintreeCustomerIdKey, out var value)) { + metadata[BraintreeCustomerIdOldKey] = value; metadata[BraintreeCustomerIdKey] = null; await stripeAdapter.CustomerUpdateAsync(customer.Id, new CustomerUpdateOptions