Repository navigation
Add vietqr-transfer extension - #24602
Conversation
- Update README and package.json - First Init
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryNew extension that generates VietQR bank transfer QR codes for Vietnamese banks. It provides a form to select a bank, enter account details, and generate a QR image URL via the VietQR API. The extension follows Raycast conventions (ESLint v9, Prettier config, changelog format, metadata screenshots) and has a clean modular structure.
Confidence Score: 2/5
Important Files Changed
Last reviewed commit: f249eb3 |
| const memoEncoded = encodeURIComponent(values.memo || ""); | ||
| const qrUrl = `https://img.vietqr.io/image/${selectedBankBin}-${values.account}-${values.template}.png?amount=${values.amount || 0}&addInfo=${memoEncoded}`; |
There was a problem hiding this comment.
logic: values.account is directly interpolated into URL path without encoding, which could cause issues if account contains special characters like slashes or hashes
| const memoEncoded = encodeURIComponent(values.memo || ""); | |
| const qrUrl = `https://img.vietqr.io/image/${selectedBankBin}-${values.account}-${values.template}.png?amount=${values.amount || 0}&addInfo=${memoEncoded}`; | |
| const accountEncoded = encodeURIComponent(values.account); | |
| const memoEncoded = encodeURIComponent(values.memo || ""); | |
| const qrUrl = `https://img.vietqr.io/image/${selectedBankBin}-${accountEncoded}-${values.template}.png?amount=${values.amount || 0}&addInfo=${memoEncoded}`; |
commented
Feb 1, 2026
|
This pull request has been automatically marked as stale because it did not have any recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊 |
commented
Feb 8, 2026
|
This pull request has been automatically closed due to inactivity. Feel free to comment in the thread when you're ready to continue working on it 🙂 You can also catch us in Slack if you want to discuss this. |
…ast height parameter
commented
Feb 16, 2026
|
Published to the Raycast Store: |
commented
Feb 16, 2026
|
🎉 🎉 🎉 Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@phucannguyen-dev). Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag. |
| export default function Command() { | ||
| const { push } = useNavigation(); | ||
| const { data, isLoading } = useFetch<{ data: Bank[] }>("https://api.vietqr.io/v2/banks"); | ||
| const [selectedBankBin, setSelectedBankBin] = useState<string>(""); |
There was a problem hiding this comment.
Silent submit failure with default bank selection
When the bank list loads from the API, Raycast's Form.Dropdown auto-selects the first item visually but does not fire onChange for that initial selection. This means selectedBankBin remains "", and the guard on line 36 (if (hasError || !selectedBankBin) return) silently blocks submission with no error feedback to the user.
The fix is to use the form's internal value from the submit handler instead of tracking it separately with useState:
| const [selectedBankBin, setSelectedBankBin] = useState<string>(""); | |
| const [selectedBankBin, setSelectedBankBin] = useState<string>(""); |
In handleSubmit, replace the usage of selectedBankBin with values.bank (the dropdown's id):
const handleSubmit = (values: FormValues) => {
// ...validation...
if (hasError || !values.bank) return;
const memoEncoded = encodeURIComponent(values.memo || "");
const qrUrl = `https://img.vietqr.io/image/${values.bank}-${values.account}-${values.template}.png?amount=${values.amount || 0}&addInfo=${memoEncoded}`;
push(<QRResult url={qrUrl} />);
};And add bank: string to the FormValues interface. This also lets you remove the selectedBankBin state and the onChange handler on the dropdown entirely.
| if (values.amount && isNaN(Number(values.amount))) { | ||
| setAmountError("Must be a valid number"); | ||
| hasError = true; |
There was a problem hiding this comment.
Amount validation allows negative numbers
isNaN(Number(values.amount)) passes for negative values like "-500" since Number("-500") is -500, which is not NaN. The account number field validates digits-only with /^\d+$/, but the amount field lacks an equivalent check. A negative amount would be passed into the QR URL, likely producing an invalid or unexpected payment code.
Consider using the same digits-only pattern:
| if (values.amount && isNaN(Number(values.amount))) { | |
| setAmountError("Must be a valid number"); | |
| hasError = true; | |
| if (values.amount && !/^\d+$/.test(values.amount)) { | |
| setAmountError("Must be a valid positive number"); | |
| hasError = true; | |
| } |
Description
📋 Summary
This extension allows users to instantly generate bank transfer QR codes following the VietQR (Napas 24/7) standard. It simplifies the process of creating payment requests by integrating with the official VietQR API to support over 50+ Vietnamese banks.
✨ Features
Instant QR Generation: Construct valid payment URLs and render QR images directly within Raycast.
Full Bank Support: Dynamic dropdown list of banks fetched from the VietQR API.
Form Validation:
🛠 Technical Details
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder