Skip to content

feat: add payment utilities#32

Open
samfert wants to merge 3 commits into
mainfrom
feature/payment-utils
Open

feat: add payment utilities#32
samfert wants to merge 3 commits into
mainfrom
feature/payment-utils

Conversation

@samfert

@samfert samfert commented Dec 3, 2025

Copy link
Copy Markdown
Owner

Summary

Adds payment utility functions to the User-Service.

Changes

  • Added PaymentUtils.java with:
    • getPaymentHistory(orderId) - Retrieve payment history for an order
    • hashCardNumber(cardNumber) - Hash card numbers for storage
    • generateTransactionId() - Generate unique transaction IDs

@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown

🤖 Devin Triggered

Devin has been assigned to fix the quality gate failures.

📊 Quality Gate Analysis

  • Total Issues: 6
  • Vulnerabilities: 1 🔴
  • Bugs: 3 🐛
  • Code Smells: 2 💨
  • Security Hotspots: 0 🔥

🔗 Links


Note: Devin will push a fix to this branch. The workflow will automatically re-run to validate.

devin-ai-integration Bot and others added 2 commits December 3, 2025 21:50
- Remove hardcoded password, use environment variable PAYMENT_DB_PASSWORD
- Use try-with-resources for Connection, PreparedStatement, and ResultSet
- Replace generic Exception with specific SQLException and NoSuchAlgorithmException
- Use static SecureRandom instead of creating new Random instance each call
- Fix SQL injection vulnerability by using PreparedStatement with parameterized query
- Change return type from ResultSet to List<Map<String, Object>> to properly manage resources

Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
- Replace MD5 (weak hash algorithm) with SHA-256 (cryptographically secure)
- Use UTF-8 charset for consistent byte encoding
- Convert hash bytes to hex string for proper representation

Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2025

Copy link
Copy Markdown

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.

1 participant