Skip to content

Commit

Permalink
Updated to include case where old key already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
cturnbull-bitwarden committed Nov 7, 2024
1 parent 4f2d167 commit 1f36f1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/Services/Implementations/StripePaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,8 +1360,9 @@ public async Task<bool> UpdatePaymentMethodAsync(ISubscriber subscriber, Payment
{
if (braintreeCustomer?.Id != stripeCustomerMetadata["btCustomerId"])
{
stripeCustomerMetadata.Add("btCustomerId_old", stripeCustomerMetadata["btCustomerId"]);
stripeCustomerMetadata["btCustomerId_old"] = stripeCustomerMetadata["btCustomerId"];

Check warning on line 1363 in src/Core/Services/Implementations/StripePaymentService.cs

View check run for this annotation

Codecov / codecov/patch

src/Core/Services/Implementations/StripePaymentService.cs#L1363

Added line #L1363 was not covered by tests
}

stripeCustomerMetadata["btCustomerId"] = braintreeCustomer?.Id;
}
else if (!string.IsNullOrWhiteSpace(braintreeCustomer?.Id))
Expand Down

0 comments on commit 1f36f1e

Please sign in to comment.