-
Notifications
You must be signed in to change notification settings - Fork 250
fix(fiat-onramp): banxa onramp flow erroneous failure popup and return to komodo button #2608
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
38a4f81
refactor(fiat-onramp): improve json parsing, logging, and doc comments
takenagain 076c1c1
refactor(webiew-dialog): improve view mode checks, and JS listener
takenagain 80e2c71
refactor(fiat-form): move url and webview mode checks to bloc
takenagain f3c7cea
fix(fiat-onramp): split initial and pending payment status
takenagain 1e1ce41
feat(webview): add CSP blockers with trusted domain filters
takenagain fa7396d
fix(fiat-onramp): open banxa in new tab rather than dialog
takenagain af5698b
fix(fiat-onramp): banxa status parsing and normalisation
takenagain 58f2e0e
refactor: implement github and coderabbit ai suggestions
takenagain f972851
fix(fiat-onramp): close checkout status redirect
takenagain adf02cc
fix(fiat-onramp): coin ticker abbr/ticker regression
takenagain 34e2965
feat(fiat-onramp): show raw provider error message on buy failure
takenagain 7e0f0f6
refactor(fiat-widget): add charset metadata and revert nav in handler
takenagain ff60f12
fix(fiat-onramp): add coin min purchase amount field as validation check
takenagain 25575ad
fix(fiat-onramp): temporarily disable coins with address format errors
takenagain efc6cea
fix(fix-onramp): ramp asset parsing and divide by zero error
takenagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,45 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
| <title>Komodo Payment Redirect</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <script> | ||
| // Extract URL parameters and put them into an object | ||
| function getParams() { | ||
| var params = {}; | ||
| window.location.search.substring(1).split("&").forEach(function (part) { | ||
| var item = part.split("="); | ||
| params[item[0]] = decodeURIComponent(item[1]); | ||
| }); | ||
| return params; | ||
| var params = {}; | ||
| window.location.search.substring(1).split("&").forEach(function (part) { | ||
| var item = part.split("="); | ||
| params[item[0]] = decodeURIComponent(item[1]); | ||
| }); | ||
| return params; | ||
| } | ||
|
|
||
| // Send the parameters to the opener window | ||
| var params = getParams(); | ||
|
|
||
| var status = params['status']; | ||
|
|
||
| console.log('opener: ' + (window.opener?.location?.href ?? 'null')); | ||
|
|
||
| if (window.opener != null && !window.opener.closed) { | ||
|
|
||
| // Temporary work-around because of Banxa checkout bug. We are polling the status of the payment | ||
| // using the order ID in the main app, but this would be better if we could get the post message | ||
| // callback to work. | ||
| if (status == null) { | ||
| status = 'unknown'; | ||
| } | ||
|
|
||
| // Send the parameters to the opener window | ||
| window.opener.postMessage({ type: 'PAYMENT-STATUS', status: status, params: params }, '*'); | ||
|
|
||
| // Change back to the opener tab | ||
| window.opener.focus(); | ||
| if (window.opener != null && !window.opener.closed) { | ||
| // Temporary work-around because of Banxa checkout bug. We are polling the status of the payment | ||
| // using the order ID in the main app, but this would be better if we could get the post message | ||
| // callback to work. | ||
| if (status == null) { | ||
| status = 'unknown'; | ||
| } | ||
|
|
||
| // Close this tab | ||
| window.close(); | ||
| } else { | ||
| // Navigate to the home page as a fallback | ||
| window.location.href = 'https://app.komodoplatform.com/'; | ||
| // Send the parameters to the opener window | ||
| window.opener.postMessage({ type: 'PAYMENT-STATUS', status: status, params: params }, '*'); | ||
| window.opener.focus(); | ||
| } | ||
|
|
||
| // Both Ramp and Banxa checkout pages are either opened in a new tab or a popup dialog webview, | ||
| // so we need to close the current window rather than redirecting back to the website. | ||
| window.close(); | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.