Skip to content

Add vietqr-transfer extension - #24602

Merged
raycastbot merged 5 commits into
raycast:mainfrom
phucannguyen-dev:ext/vietqr-transfer
Feb 16, 2026
Merged

raycastbot merged 5 commits into
raycast:mainfrom
phucannguyen-dev:ext/vietqr-transfer

Conversation

@phucannguyen-dev

@phucannguyen-dev phucannguyen-dev commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Account Number: Required field with blur and submit-time validation.
  • Amount: Optional field with numeric-only validation to prevent invalid URL parameters.
  • Customizable Templates: Supports Compact (with details), QR Only, and Print (large) styles.
  • Quick Actions: One-click to copy the QR image link or open it in a browser for sharing.

🛠 Technical Details

  • Architecture: Modular structure with components and types separated for better maintainability and to avoid React Hook context issues.
  • Utilities: Uses @raycast/utils for efficient data fetching and navigation.
  • Validation: Implemented local state-based validation for real-time user feedback.

Screencast

vietqr-transfer-1 vietqr-transfer-2 vietqr-transfer-3 vietqr-transfer-3 2

Checklist

- Update README and package.json
- First Init
@raycastbot

ghost commented Jan 17, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@phucannguyen-dev
phucannguyen-dev marked this pull request as ready for review January 17, 2026 11:41
@greptile-apps

ghost commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

New 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.

  • Critical bug: The bank dropdown tracks its selection via useState + onChange, but Raycast's Form.Dropdown does not fire onChange for the initially auto-selected item when items load asynchronously. This causes the form to silently fail on submit if the user never manually changes the bank. The fix is to read values.bank from the submit handler instead.
  • Validation gap: Amount validation uses isNaN(Number(...)) which permits negative numbers — these would produce invalid payment QR URLs. Should use a digits-only check consistent with the account number validation.
  • Non-standard field: importPath in the command definition is not used by any other extension in the repository (0 out of 2,538 others). It appears unnecessary since Raycast resolves commands by name convention.

Confidence Score: 2/5

  • This PR has a critical UX bug where form submission silently fails with the default bank selection, requiring fixes before merge.
  • The bank dropdown state tracking bug means the extension will not work on first use without the user manually re-selecting a bank — a confusing and broken experience. The negative amount validation gap is a secondary concern. Configuration and project structure are otherwise solid.
  • extensions/vietqr-transfer/src/transfer-qr-generator.tsx needs attention for the dropdown state bug and amount validation fix.

Important Files Changed

Filename Overview
extensions/vietqr-transfer/src/transfer-qr-generator.tsx Main form command: has a critical bug where the bank dropdown's initial auto-selection is not captured by onChange state, causing silent submit failures; also allows negative amounts through validation.
extensions/vietqr-transfer/src/components/QRResult.tsx Simple Detail view that renders the QR image and provides copy/open actions. Clean and straightforward.
extensions/vietqr-transfer/src/types.ts Type definitions for Bank and FormValues. FormValues is missing the bank field which should be added when fixing the dropdown bug.
extensions/vietqr-transfer/package.json Extension manifest with correct structure, proper categories, and platforms. Contains non-standard importPath field in command definition that no other extension uses.

Last reviewed commit: f249eb3

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +30 to +31
const memoEncoded = encodeURIComponent(values.memo || "");
const qrUrl = `https://img.vietqr.io/image/${selectedBankBin}-${values.account}-${values.template}.png?amount=${values.amount || 0}&addInfo=${memoEncoded}`;

ghost Jan 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: values.account is directly interpolated into URL path without encoding, which could cause issues if account contains special characters like slashes or hashes

Suggested change
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}`;

@raycastbot

ghost commented Feb 1, 2026

Copy link
Copy Markdown
Collaborator

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 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Feb 1, 2026
@raycastbot

ghost commented Feb 8, 2026

Copy link
Copy Markdown
Collaborator

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.

@raycastbot raycastbot closed this Feb 8, 2026
@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Feb 8, 2026

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 9adf9a8 into raycast:main Feb 16, 2026
@github-actions

ghost commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

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.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

15 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

export default function Command() {
const { push } = useNavigation();
const { data, isLoading } = useFetch<{ data: Bank[] }>("https://api.vietqr.io/v2/banks");
const [selectedBankBin, setSelectedBankBin] = useState<string>("");

ghost Feb 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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.

Comment on lines +31 to +33
if (values.amount && isNaN(Number(values.amount))) {
setAmountError("Must be a valid number");
hasError = true;

ghost Feb 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants