Skip to content

Conversation

@Fabcien
Copy link

@Fabcien Fabcien commented Feb 9, 2026

When a deeplink is not handled by an app on the user device, the browser opens the /app page and attempts to open the cashtab web wallet.

The cashtab extension is managed on the client-side and doesn't need to happen on the server side: if the user has no app nor extension installed, redirecting to cashtab is the expected behavior.

This has been tested on a dev server by manually calling the URL like so: http://localhost:3000/app?address=ecash:qplv39yx80kdqejh4ag6c3t30aatj9mausupeyjzr7&amount=100.00

Summary by CodeRabbit

  • New Features
    • Added a new endpoint for handling cryptocurrency payment links
    • Payment links automatically redirect to Cashtab with properly formatted transaction data
    • Implemented error handling that displays user-friendly messages for invalid payment links

const webUrl = `https://cashtab.com/#/send?bip21=${bip21String}`

try {
const isAvailable = await cashtab.isExtensionAvailable()
Copy link
Author

Choose a reason for hiding this comment

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

This might actually not be needed as it seems impossible to install the cashtab extension on mobile anyway, so we could jump to cashtab web directly and only handle cashtab-connect on the client to save a redirect. Waiting for confirmation.

When a deeplink is not handled by an app on the user device, the browser opens the /app page and attempts to open the cashtab extension, then the cashtab web wallet if the extension is not available or the user rejects the payment.

This has been tested on a dev server by manually calling the URL like so: http://localhost:3000/app?address=ecash:qplv39yx80kdqejh4ag6c3t30aatj9mausupeyjzr7&amount=100.00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

 __________________________________________________
< Turning your WTFs per minute into OMGs per hour. >
 --------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Two files are modified to implement a new BIP21 redirect handler. The auth configuration adds "/app" to authorized unlogged URLs, and a new Next.js page handles server-side BIP21 validation and client-side redirect logic to Cashtab with appropriate error handling.

Changes

Cohort / File(s) Summary
Authentication Configuration
pages/_app.tsx
Added "/app" to AUTHORIZED_UNLOGGED_URLS to allow unauthenticated access to the new app redirect page.
BIP21 Redirect Handler
pages/app/index.tsx
New page implementing server-side BIP21 string construction via getServerSideProps with address validation and query parameter filtering. Client component redirects to Cashtab or displays error/redirect message accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰✨ A path to BIP21 so fine,
Server-side logic in perfect line,
Validate and redirect with care,
To Cashtab's wallet, swift through air! 🪙

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description explains the feature context and testing approach, but omits the required 'Related to #' issue reference and 'Test plan' section from the template. Add the GitHub issue reference (Related to #) and provide a more detailed test plan section beyond the single manual test example.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Handle deeplinks fallback mode' accurately and concisely describes the main change: implementing a fallback flow for deeplinks when apps are unavailable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Fabcien added a commit to Fabcien/paybutton that referenced this pull request Feb 9, 2026
Cashtab will still be called via a redirection if no app handles the link first. This makes this code compatible with both mobile and desktop with no special case.

Works together with PayButton/paybutton-server#1106.
@Fabcien
Copy link
Author

Fabcien commented Feb 9, 2026

Simplified by not handling cashtab-connect which is not needed, see PayButton/paybutton#611

@Klakurka Klakurka self-requested a review February 9, 2026 22:06
@Klakurka Klakurka added enhancement (UI/UX/feature) New feature or request enhancement (behind the scenes) Stuff that users won't see labels Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement (behind the scenes) Stuff that users won't see enhancement (UI/UX/feature) New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants