From 1f36f1e9f2a86bd287cb026aa6561609b159d300 Mon Sep 17 00:00:00 2001 From: Conner Turnbull Date: Thu, 7 Nov 2024 12:52:40 -0500 Subject: [PATCH] Updated to include case where old key already exists --- src/Core/Services/Implementations/StripePaymentService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 60dff6ae6b37..259a4eb7572a 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -1360,8 +1360,9 @@ public async Task UpdatePaymentMethodAsync(ISubscriber subscriber, Payment { if (braintreeCustomer?.Id != stripeCustomerMetadata["btCustomerId"]) { - stripeCustomerMetadata.Add("btCustomerId_old", stripeCustomerMetadata["btCustomerId"]); + stripeCustomerMetadata["btCustomerId_old"] = stripeCustomerMetadata["btCustomerId"]; } + stripeCustomerMetadata["btCustomerId"] = braintreeCustomer?.Id; } else if (!string.IsNullOrWhiteSpace(braintreeCustomer?.Id))