From e83d7a3f6fd0d835c0e1a9e6f5d537b3237628f0 Mon Sep 17 00:00:00 2001 From: Conner Turnbull Date: Tue, 19 Nov 2024 15:07:06 -0500 Subject: [PATCH] Updated customer metadata when updating to use bank account --- 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