feat: add search by payref - #18
Conversation
Summary of ChangesHello @martinserts, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new capability to the payment processor's API, enabling users to search for specific payments using their unique payment reference ( Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new API endpoint to search for payments using payref, which is a valuable addition. The implementation is sound, including a database migration to add a necessary index for performance. My primary feedback concerns an opportunity to improve code maintainability by addressing duplicated code in the database access layer. A new function is nearly identical to an existing one, and I've provided a suggestion to refactor this by extracting the common logic.
Description
Adds an API to search payments by
payrefCloses #5
How Has This Been Tested?
Run the payment processor
Fails on non-existent payref
{ "error": "Payment not found" }Finds existing one
{ "payment_id": "b30b246c-735a-488f-81c9-5c2f6e814c17", "status": "CONFIRMED", "client_id": "pay_2_2", "account_name": "default", "recipient_address": "f2LUUip8F3LCQ6PyJvQiySCEpQyzTQSfvQF4YX3N9pY4rz4gAUprFgaL9JANYinYN2HGtKexmfX2odeNHfatoNhozaL", "amount": 2000000, "payref": "d330d2c5f7c2242f87634ba7b2db408e24fa9dd9590354b421ba024f0467992a", "mined_height": 372858, "mined_header_hash": "4216e29bbd79035af314fb64b48999295ff2431aaf76c7b299dde71b3753bbba", "mined_timestamp": 1765289952, "created_at": "2025-12-09T14:17:39Z", "updated_at": "2025-12-09T14:35:19Z" }What process can a PR reviewer use to test or verify this change?
Breaking Changes