feat: add payment processor for new transaction flow#26
Merged
Conversation
6738786 to
f7eb96b
Compare
adfa104 to
65fb2db
Compare
🤖 Devin AI Quality Gate Remediation TriggeredA SonarQube Quality Gate Remediation Specialist (Devin AI) has been assigned to fix all quality gate failures. 📊 Quality Gate Analysis
🔗 LinksNote: Devin will push a fix to this branch. The workflow will automatically re-run to validate. |
🤖 Devin AI Quality Gate Remediation TriggeredA SonarQube Quality Gate Remediation Specialist (Devin AI) has been assigned to fix all quality gate failures. 📊 Quality Gate Analysis
🔗 LinksNote: Devin will push a fix to this branch. The workflow will automatically re-run to validate. |
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…Random and logger formatting Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
5f78ff8 to
1a0c086
Compare
🤖 Devin AI Quality Gate Remediation TriggeredA SonarQube Quality Gate Remediation Specialist (Devin AI) has been assigned to fix all quality gate failures. 📊 Quality Gate Analysis
🔗 LinksNote: Devin will push a fix to this branch. The workflow will automatically re-run to validate. |
…ure demo folder as Maven project Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…erties settings Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…ve test coverage to 80% Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…ature/vulnerable-code Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…ak and SELECT * query Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…ature/vulnerable-code Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…sultSet tests Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…ature/vulnerable-code Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…simplified getUserByUsername Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…d removed) Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…mResultSet method Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
…prove coverage Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a new
PaymentProcessorclass to handle payment transactions with security best practices:PreparedStatementwith parameterized queriesDB_URL,DB_USER,DB_PASSWORD)SecureRandomfor transaction ID generation and SHA-256 for hashingConnectionandStatementcleanupjava.util.logging.Loggerwith lazy evaluation; masks card numbers in logsSonarQube Quality Gate Status
Status: PASSING
All code quality conditions met:
Updates Since Last Revision
Added complete Maven build infrastructure and test coverage to resolve the quality gate:
demo/pom.xml): Added JUnit 5, Mockito, and JaCoCo for test coverage reportingPaymentProcessorandVulnerableCodeclasses (~45 test cases)sonar-project.propertiesto properly configure sources, tests, and coverage pathsReview & Testing Checklist for Human
DB_URL,DB_USER,DB_PASSWORD) and testprocessPayment()against a real/test database - unit tests only verify SQLException is thrown when DB unavailableDB_PASSWORDdefaults to empty string when env var not set - verify this is acceptable for your deploymentdemo/folder withpackage demo;- verify this is the intended location vs. standardcom.banking.demostructureTest Plan
DB_URL,DB_USER,DB_PASSWORDpaymentstable containingaccount_id,amount,descriptioncolumnsprocessPayment()and verify record is insertedgenerateTransactionId()multiple times and verify unique IDslogPayment()and verify card numbers are masked in outputNotes
Link to Devin runs:
Requested by: Sam Fertig (sam.fertig@cognition.ai) (@samfert-codeium)