-
Notifications
You must be signed in to change notification settings - Fork 134
Improve way we show QR invoice to seller #652
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
Conversation
## Walkthrough
This update introduces a new asynchronous function to display QR codes for order invoices, modifies message formatting and flow for payment requests and pending sales, adds a new bot action handler for QR code display, enhances Spanish locale warnings and instructions, and updates two package dependencies.
## Changes
| Files/Groups | Change Summary |
|------------------------------------------------|----------------|
| `bot/commands.ts` | Added `showQrCode` async function to retrieve and display a QR code for an order's invoice, updated imports, improved error handling, and performed minor cleanup of unused variables and imports; enhanced order cancellation logic for any order in waiting payment status with clearer conditional blocks. |
| `bot/messages.ts` | Modified `invoicePaymentRequestMessage` to remove an unused parameter and sanitize input; added `showQRCodeMessage` to generate and send QR code images as photo media groups with MarkdownV2 captions; updated message formatting and inline keyboard for payment continuation; updated export list accordingly. |
| `bot/start.ts` | Added a new action handler for `showqrcode_` callback queries, integrating user validation and QR code display logic with error handling and message deletion; imported `showQrCode` command. |
| `locales/es.yaml` | Expanded and clarified Spanish locale messages for invoice payment requests and pending sales, adding detailed warnings, instructions, and disclaimers emphasizing image verification and user responsibility. |
| `locales/de.yaml`, `locales/en.yaml`, `locales/fa.yaml`, `locales/fr.yaml`, `locales/it.yaml`, `locales/ko.yaml`, `locales/pt.yaml`, `locales/ru.yaml`, `locales/uk.yaml` | Revised localization strings to improve clarity, add explicit multi-line warnings about invoice payment safety, emphasize image verification, include legal disclaimers, and clarify order handling instructions without changing underlying logic or control flow. |
| `package.json` | Updated `axios` dependency from `^1.8.2` to fixed `1.9.0` and `lightning` from `9.8.1` to `10.25.0`. |
## Suggested reviewers
- grunch
## Poem
> 🐇 Hop, hop, a QR code in sight,
> Scan it quick, the payment’s right!
> Warnings clear in every tongue,
> Safety first, the song is sung.
> Dependencies fresh, the bot’s anew,
> Carrots and code, just for you! 🌟🥕Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
locales/ru.yaml (1)
58-58: Remove trailing whitespace
YAMLlint flagged trailing spaces in this file (line 58). Please remove any trailing spaces to satisfy YAML syntax rules.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 58-58: trailing spaces
(trailing-spaces)
locales/fa.yaml (2)
39-50: Verify Persian Markdown formatting and placeholder consistencyThis block introduces critical safety warnings. Please confirm:
- All
*…*markers render correctly in the Telegram client (e.g., ensure parentheses and punctuation are escaped for MarkdownV2 if needed).- Placeholder names (
${order.amount},${currency},${order.fiat_amount},${rate},${days}) exactly match the code that injects them.- Terminology consistency for “sats” vs “ساتوشی” across all Persian locale entries—consider unifying the term.
52-60: Check legal disclaimer translation and punctuationThe new multi-line disclaimer mirrors other locales, but please verify:
- Sentence endings use consistent Persian punctuation (periods, commas).
- The warning about developers/dispute resolvers aligns exactly with the English source.
- References to
/disclaimerand command styling match other parts of the file.locales/de.yaml (2)
37-49: Validate German Markdown syntax and placeholdersThis invoice request segment uses bold/italic markers (
*…*) and inline emojis. Please ensure:
- All special characters (quotes, emojis, parentheses) are correctly escaped under MarkdownV2.
- Placeholders (
${order.amount},${currency},${order.fiat_amount},${rate},${days}) match the code.- The phrasing (“Ein Benutzer möchte…”) is consistent with other locales in tone and structure.
52-62: Confirm German disclaimer and cancellation instructionsThe pending sell block adds legal disclaimers and command hints. Please check:
- Punctuation consistency at line ends.
- Accuracy of “/disclaimer” reference and that responsibility waiver matches source.
- Uniformity of channel placeholder
${channel}formatting.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
bot/commands.ts(5 hunks)locales/de.yaml(1 hunks)locales/en.yaml(1 hunks)locales/es.yaml(1 hunks)locales/fa.yaml(1 hunks)locales/fr.yaml(1 hunks)locales/it.yaml(1 hunks)locales/ko.yaml(1 hunks)locales/pt.yaml(1 hunks)locales/ru.yaml(1 hunks)locales/uk.yaml(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- locales/fr.yaml
- locales/it.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
- bot/commands.ts
- locales/es.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
locales/ru.yaml
[error] 58-58: trailing spaces
(trailing-spaces)
🔇 Additional comments (10)
locales/ko.yaml (2)
38-48: Approve enhanced invoice payment warning in Korean
The updatedinvoice_payment_requestincludes clear, multi-line warnings prompting the user to verify the order image against the QR code, matching other locales and supporting the new QR code display feature. Placeholders (${order.amount},${currency},${order.fiat_amount},${rate},${days}) are correctly positioned.
51-60: Approve added disclaimers in pending sell message
Thepending_sellmessage now reminds users to remember the image, disclaims developer/arbitrator liability, and notes terms acceptance—consistent with other languages and the new QR code functionality.locales/en.yaml (2)
39-50: Approve invoice payment request improvements
The Englishinvoice_payment_requestwas enhanced with explicit reputation info and cautionary steps (verify image, view QR code) and aligns with MarkdownV2 formatting. Placeholders and formatting look correct.
52-62: Approve updated pending sell instructions
Thepending_selltext now concisely reminds users to recall the image, disclaims liability, and confirms terms acceptance. It aligns with UX requirements for QR code display.locales/pt.yaml (2)
36-47: Approve Portuguese invoice payment warnings
Theinvoice_payment_requestin Portuguese mirrors the English enhancements: buyer details, strong warnings to recheck images, and guidance to decide next steps. Variables and Markdown emphasis are correctly applied.
49-60: Approve Portuguese pending sell disclaimers
Thepending_sellmessage now includes image-verification reminders, liability disclaimers, and terms acceptance—consistent with other locales and the new QR display feature.locales/uk.yaml (2)
36-47: Approve Ukrainian invoice payment request enhancements
Theinvoice_payment_requesthas been updated with reputation context and prominent multi-line warnings to verify images before payment, matching the UX improvements. Variables and formatting appear correct.
49-60: Approve Ukrainian pending sell message updates
Thepending_sellsection now reminds users to remember the image, disclaims developer/arbitrator liability, and notes terms/privacy acceptance—aligned with other locales and new QR code features.locales/ru.yaml (2)
36-47: Approve Russian invoice payment request changes
The Russianinvoice_payment_requestnow uses “Пользователь хочет купить…” phrasing, includes buyer reputation and strong warnings to re-check the image before payment, aligning with other translations.
49-60: Approve Russian pending sell disclaimer updates
Thepending_sellupdate adds image-memory prompts, liability disclaimers, and terms acceptance—consistent with the QR code UX and other locales.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 58-58: trailing spaces
(trailing-spaces)
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores