-
Notifications
You must be signed in to change notification settings - Fork 35
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
Remove prefix from QR code scans #121
Conversation
Thanks! I did encounter one issue though, using the QR code example from below as provided by a community member via https://coincards.com/ca/all-gift-cards/ Scanning this code also adds a suffix indicating the amount to be paid as shown in the image below As this is related to this PR, but outside the original scope, I can create a new issue for this unless you prefer to continue in this PR. For the suffix, redaction could be the simplest option, but it would be a nice UX enhancement to have the
|
@smk762 We could pivot this to be regex-based, which would then cover all current and future issues instead of having to add a handle for each new one. Can you provide a regex that's safe to use for address sanitation? |
For Address: For Amount: You can use the second one for any other anticipated query param like fields for |
Did not modify PaymentUriInfo to avoid issues with segwit variants
Thanks for the regex, @smk762. The Amount field should now be populated if there is an I noticed the error below when scanning |
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.
I can confirm that address and amount are parsed and populate the send form fields as expected. I did not encounter any address validation errors with LTC/LTC-segwit scanning the same QR code, and where amount was greater than balance, the red box error showed as expected.
I was however able to scan a BLK qr code when attempting to send LTC. It populated the address field, then showed error when attempting to send. This is expected behaviour, I think validation taking place here rather than at scan is ok.
LGTM, thanks!
Fixes #120 by removing the prefix from the address when it is scanned in.
Before:
After: