Repository navigation
Open Venmo app from Pay with Venmo on Chrome and in-app browsers - #177
Conversation
Chrome (iOS and Android) and in-app browsers don't hand venmo.com links off to the app the way Safari does, so buyers had to switch apps and retype the note and amount, breaking payment matching. - iOS browsers other than Safari use the venmo://paycharge deep link - Android uses an intent:// URL with package=com.venmo and a browser fallback - both fall back to the venmo.com link if the page is still visible after 2s - iOS Safari and desktop keep the existing venmo.com link
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Emir icyer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
- Move the app-open fallback into lib/venmo.ts so it can be tested - Add Vitest to the frontend with tests for the URL builders, platform detection and every fallback path - Run frontend tests in CI
Pay with Venmo now opens the Venmo app, with the amount and order ID prefilled, on Chrome (iOS and Android) and in in-app browsers, not just in Safari.
Description / overview
Problem: in Chrome and in-app browsers (Instagram, GroupMe), the
https://venmo.com/...link stayed in the browser instead of opening the app. Buyers had to retype the note and amount, which broke automatic payment matching.New
VenmoPayButton(frontend/src/components/custom/VenmoPayButton.tsx) picks the link by platform:https://venmo.com/{user}?txn=pay¬e=…&amount=…(unchanged; Safari opens it in the app as a universal link)venmo://paycharge?txn=pay&recipients=…&amount=…¬e=…intent://paycharge?…#Intent;scheme=venmo;package=com.venmo;S.browser_fallback_url=…;endFallback when Venmo isn't installed: if the page is still in the foreground 2s after the tap, it goes to the venmo.com link.
blur,pagehideor the page becoming hidden cancels this.URL building, platform detection and the fallback are in
frontend/src/lib/venmo.ts. The order page no longer builds Venmo URLs inline. Copy Link still copies the https link, because it works wherever it's pasted.Tests: Vitest added to the frontend (
pnpm test) and run in CI.Docs:
docs/venmo-payment-links.mdcovers usage, behavior per platform, edge cases and the implementation.How you tested
Automated
cd frontend && pnpm testruns 21 tests insrc/lib/venmo.test.ts:& # =and spacesblur,pagehideand hidden cancel it, and listeners are cleaned upManual
To reproduce on a phone
/buyer/order/{id}.Dependencies
None.
Appendix / notes
pnpm-lock.yamlentries for the newvitestdevDependency. The rest is about 135 lines of tests, 99 of docs, and about 135 of source.vitest, plus aTest frontendstep in.github/workflows/ci.yml.