Skip to content

Fix MoonPay "Send with Edge" sell link#6056

Open
j0ntz wants to merge 1 commit into
developfrom
jon/moonpay-payment-deeplink
Open

Fix MoonPay "Send with Edge" sell link#6056
j0ntz wants to merge 1 commit into
developfrom
jon/moonpay-payment-deeplink

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana task

Asana: https://app.asana.com/1/9976422036640/project/1207384676342554/task/1209649066660320

Fixes the MoonPay "Send with Edge" sell link. When a user starts a MoonPay sell order but has not completed the crypto deposit, MoonPay shows a "complete payment" button (in their email and in the buy.moonpay.com/trade_history page) that reflects back the deposit redirect URL our app hands MoonPay. That button dead-ended on a static "Redirecting to Payment..." page, so the user could not finish the deposit (the reported lead case is an XRP sell that also needs a destination tag).

Root cause (regression analysis). The redirect URL we pass to MoonPay is RETURN_URL_PAYMENT in src/plugins/gui/providers/common.ts. It has been https://edge.app/redirect/payment/ since it was introduced (Oct 2023); it was never a deep.edge.app value, so this is not a value regression. The apex edge.app host is not claimed as a universal link on iOS (ios/edge/edge.entitlements) or Android (AndroidManifest.xml) - only deep.edge.app, dl.edge.app, and return.edge.app are. The constant was designed as an in-app webview interception sentinel (uri.startsWith(RETURN_URL_PAYMENT)), which works in-app but cannot open the app from an external click. The buy redirects already use deep.edge.app; only the sell payment redirect used the unclaimed apex.

Fix.

  • Point RETURN_URL_PAYMENT at the claimed deep.edge.app host, matching the buy redirects. In-app interception is host-agnostic (prefix startsWith), so the existing webview flows (MoonPay and Paybis, ramp and legacy) are unaffected.
  • Parse the redirect/payment deep link into a new paymentRedirect link type and route it to the Send scene, resolving the wallet from the base currency code and pre-filling the deposit address, amount, and destination tag/memo (via uniqueIdentifier). Both the deep.edge.app and legacy edge.app hosts are parsed.

No new user-facing strings; reuses the existing Send scene and wallet picker.

Testing.

  • Unit tests for the parser (real-world MoonPay URL, XRP with destination tag, deep.edge.app host, and missing-param browser fallback).
  • verify-repo.sh (eslint + jest) passes; tsc clean.
  • Driven on the iOS simulator: firing edge://redirect/payment/?baseCurrencyCode=btc&baseCurrencyAmount=0.001&depositWalletAddress=bc1q... opens the wallet picker (all BTC wallets) and then the Send scene pre-filled with the deposit address and 0.001 BTC. Screenshots below. The slider is not confirmed (no broadcast).

Note

Medium Risk
Changes fiat sell completion URLs and deep-link routing into Send with user funds; scope is bounded by reusing existing Send/wallet picker and prefix-based in-app interception.

Overview
Fixes MoonPay "Send with Edge" sell completion links so external taps open Edge instead of a dead-end redirect page.

RETURN_URL_PAYMENT now uses https://deep.edge.app/redirect/payment/ (claimed universal-link host) instead of the unclaimed edge.app apex; in-app WebView interception via startsWith(RETURN_URL_PAYMENT) is unchanged.

Adds a paymentRedirect deep-link type: /redirect/payment/ URLs (MoonPay query params: baseCurrencyCode, depositWalletAddress, optional amount and depositWalletAddressTag) parse on both deep.edge.app and legacy edge.app. Missing required params degrade to noop (edge scheme) or browser (https apex). Handling resolves matching native/token assets, wallet picker, then handleWalletUris into Send with deposit address, amount, and memo/tag.

Reviewed by Cursor Bugbot for commit 961a3fb. Bugbot is set up for automated code reviews on this repo. Configure here.

@j0ntz

j0ntz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence (iOS sim)

agent proof 1209649066660320 01 wallet picker

agent proof 1209649066660320 01 wallet picker

agent proof 1209649066660320 02 send prefilled

agent proof 1209649066660320 02 send prefilled

Captured by the agent's in-app test run (build-and-test).

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 676c146. Configure here.

Comment thread src/util/DeepLinkParser.ts
Comment thread src/actions/DeepLinkingActions.tsx Outdated
MoonPay surfaces a "Send with Edge" button for pending sell orders (in
their email and order-history page) that reflects back the deposit
redirect URL our app hands them. That URL was RETURN_URL_PAYMENT =
https://edge.app/redirect/payment/, but the apex edge.app host is NOT
claimed as a universal link on iOS or Android (only deep.edge.app, dl,
and return are), so the button dead-ended on a static redirect page and
the user could not complete the deposit. The buy redirects already use
deep.edge.app; only the sell payment redirect used the unclaimed apex.

Point RETURN_URL_PAYMENT at the claimed deep.edge.app host (in-app
webview interception is host-agnostic via startsWith, so it is
unaffected) and parse the redirect/payment deep link into a new
paymentRedirect link that opens the Send scene, resolving the wallet
from the base currency code and pre-filling the deposit address, amount,
and destination tag (needed for chains like XRP). Both the deep.edge.app
and legacy edge.app hosts are parsed.
@j0ntz j0ntz force-pushed the jon/moonpay-payment-deeplink branch from 676c146 to 961a3fb Compare June 24, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant