feat: embed coinbase payment in keychain popup with status polling#2445
Merged
feat: embed coinbase payment in keychain popup with status polling#2445
Conversation
Instead of opening the raw Coinbase payment link directly in the popup, open it embedded in the keychain app at /coinbase?paymentLink=...&orderId=... This ensures: - The popup top-level domain is x.cartridge.gg so the Coinbase iframe works - The popup page independently polls order status via GraphQL - Auto-closes on successful payment - Shows failure/timeout messages within the popup - The keychain also continues polling from its side
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Capture txHash from the coinbaseOnrampOrder polling response and thread it through the OnchainPurchaseContext so bridge.tsx can use it to construct the layerswap explorer link for Apple Pay purchases.
Contributor
|
Claude finished @broody's task —— View job Documentation Analysis CompleteReviewed PR #2445 for user-facing documentation impacts. Todo List
Analysis SummaryPR Changes:
Documentation Decision: NO CHANGES NEEDED This PR is an internal implementation improvement that enhances reliability and UX but does not change any user-facing APIs or integration patterns: ✅ What remains the same:
✅ Why no docs update:
The implementation details (iframe vs. direct popup, polling intervals, timeout values) are intentionally not documented as they're subject to change and don't affect the developer experience. --- • Branch: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Instead of opening the raw Coinbase payment link directly in the popup window, this embeds it within the keychain app at
/coinbase?paymentLink=...&orderId=....Problem
When opening the Coinbase payment link directly in a popup, Coinbase renders the "Buy now with Apple Pay" button but cannot detect when the payment succeeds because the page lacks the additional polling logic.
Solution
New
/coinbaseroute (coinbase-popup.tsx) in the keychain app that:x.cartridge.gg)coinbaseOnrampOrderstatus via GraphQL every 5 secondsUpdated
openPaymentPopupto construct the keychain URL instead of opening the raw Coinbase linkRoute registered outside the
Authenticationwrapper so it works as a standalone popup pageChanges
packages/keychain/src/components/coinbase-popup.tsx— new standalone popup pagepackages/keychain/src/components/app.tsx— added/coinbaseroutepackages/keychain/src/hooks/starterpack/coinbase.ts— updated popup URL construction