Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated customer metadata to only store one old btCustomerId #4997

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Core/Services/Implementations/StripePaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@
}
else
{
invoice = await _stripeAdapter.InvoiceFinalizeInvoiceAsync(subResponse.LatestInvoiceId,

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

View workflow job for this annotation

GitHub Actions / Quality scan

'subResponse' is null on at least one execution path. (https://rules.sonarsource.com/csharp/RSPEC-2259)
new InvoiceFinalizeOptions { AutoAdvance = false, });
await _stripeAdapter.InvoiceSendInvoiceAsync(invoice.Id, new InvoiceSendOptions());
paymentIntentClientSecret = null;
Expand All @@ -869,7 +869,7 @@
else if (!invoice.Paid)
{
// Pay invoice with no charge to customer this completes the invoice immediately without waiting the scheduled 1h
invoice = await _stripeAdapter.InvoicePayAsync(subResponse.LatestInvoiceId);

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

View workflow job for this annotation

GitHub Actions / Quality scan

'subResponse' is null on at least one execution path. (https://rules.sonarsource.com/csharp/RSPEC-2259)
paymentIntentClientSecret = null;
}

Expand Down Expand Up @@ -1360,8 +1360,7 @@
{
if (braintreeCustomer?.Id != stripeCustomerMetadata["btCustomerId"])
{
var nowSec = Utilities.CoreHelpers.ToEpocSeconds(DateTime.UtcNow);
stripeCustomerMetadata.Add($"btCustomerId_{nowSec}", stripeCustomerMetadata["btCustomerId"]);
stripeCustomerMetadata.Add("btCustomerId_old", stripeCustomerMetadata["btCustomerId"]);
}
stripeCustomerMetadata["btCustomerId"] = braintreeCustomer?.Id;
}
Expand Down
Loading