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

[PM-7452] Resolve PayPal issue #25

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lizard-boy
Copy link

@lizard-boy lizard-boy commented Oct 19, 2024

🎟️ Tracking

📔 Objective

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Greptile Summary

Enhanced error logging and Braintree configuration debugging for Stripe invoice processing.

  • Added exception message logging in InvoiceCreatedHandler for 'invoice.created' event handling
  • Implemented LogBraintreeConfiguration() method in StripeEventUtilityService for QA environment debugging
  • Exceptions are now re-thrown after logging in InvoiceCreatedHandler, potentially affecting error handling
  • Braintree configuration logging includes partial Merchant ID, Public Key, and Private Key for security

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

parsedEvent.Id,
exception.Message);

throw;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Re-throwing the exception after logging. Ensure this change in behavior is intended and handled appropriately by the caller.

parsedEvent.Id,
exception.Message);

throw;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Another instance of re-throwing the exception. Verify that this is the desired behavior.

@@ -261,6 +261,8 @@ invoice is

private async Task<bool> AttemptToPayInvoiceWithBraintreeAsync(Invoice invoice, Customer customer)
{
LogBraintreeConfiguration();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider moving this method call to the constructor to ensure logging happens only once per service instance


private void LogBraintreeConfiguration()
{
var environment = System.Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Use IHostEnvironment instead of Environment.GetEnvironmentVariable for consistency with ASP.NET Core practices

}
else
{
_logger.LogInformation("Braintree Merchant ID: {MerchantId}", merchantId[..5]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Logging even partial keys could be a security risk. Consider using a boolean flag instead

}
else
{
_logger.LogInformation("Braintree Public Key: {PublicKey}", publicKey[..5]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Logging even partial keys could be a security risk. Consider using a boolean flag instead

}
else
{
_logger.LogInformation("Braintree Private Key: {PrivateKey}", privateKey[..5]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Logging even partial keys could be a security risk. Consider using a boolean flag instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants