-
Notifications
You must be signed in to change notification settings - Fork 965
Rewards bitflyer android integration #11587
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
Conversation
Add Balance related info
Add balance report
Add observer for tip update Add bifluer changes
Remove verify banner Updfate rewards modal pref
0fb2072
to
e989f67
Compare
@@ -69,7 +69,7 @@ void LoadRewardsURL( | |||
const std::string bitflyer_staging_host = bitflyer_staging_url.host(); | |||
const std::string gemini_staging_host = gemini_oauth_staging_url.host(); | |||
const char* kAllowedDomains[] = { | |||
"bitflyer.com", // bitFlyer production | |||
"dummy.com", // bitFlyer production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a real domain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the bitFlyer production domain is stubbed out for now per request from @Miyayes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will we be changing this to before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zenparsing rightly pointed out that this won't work as-is, so we're reverting it and will rely on stubbing the production client id in our builds instead.
@deeppandya I think we need to check it on Android 6, as the PR contains new vector images. |
@SergeyZhukovsky I have checked. If we use support components, it's fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
intent.putExtra( | ||
BraveActivity.OPEN_URL, BraveWalletProvider.UPHOLD_ORIGIN_URL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deeppandya If this function is Uphold-specific, do we need a bitFlyer-specific function. If it's not Uphold-specific, then it seems like we need to be smarter here (and probably should rename the function, etc.)
redirect_url = jsonObj.getString(REDIRECT_URL_KEY); | ||
} | ||
} catch (JSONException e) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log something here?
SharedPreferences.Editor editor = sharedPref.edit(); | ||
int rightDrawable = 0; | ||
int leftDrawable = 0; | ||
int text = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe textId
is a better name here?
@@ -170,6 +170,8 @@ | |||
public static final String ADD_FUNDS_URL = "chrome://rewards/#add-funds"; | |||
public static final String REWARDS_SETTINGS_URL = "chrome://rewards/"; | |||
public static final String BRAVE_REWARDS_SETTINGS_URL = "brave://rewards/"; | |||
public static final String BRAVE_REWARDS_SETTINGS_WALLET_PROVIDER_URL = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would name this BRAVE_REWARDS_SETTINGS_WALLET_VERIFICATION_URL
just to be a little more specific.
view.getLocationOnScreen(location); | ||
int x = location[0]; | ||
int y = location[1]; | ||
loginPopupWindow.showAtLocation(view, Gravity.NO_GRAVITY, 0, y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking that we don't want to use x
here?
} | ||
} else if (errorCode == BraveRewardsNativeWorker.LEDGER_ERROR) { // No Internet connection | ||
String args[] = {}; | ||
Log.e(TAG, "LEDGER_ERROR"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could say something like Failed to fetch rewards parameters from server
(or something like that) here?
@@ -69,7 +69,7 @@ void LoadRewardsURL( | |||
const std::string bitflyer_staging_host = bitflyer_staging_url.host(); | |||
const std::string gemini_staging_host = gemini_oauth_staging_url.host(); | |||
const char* kAllowedDomains[] = { | |||
"bitflyer.com", // bitFlyer production | |||
"dummy.com", // bitFlyer production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will we be changing this to before merging?
@@ -312,6 +312,8 @@ class RewardsService : public KeyedService { | |||
|
|||
virtual void GetExternalWallet(GetExternalWalletCallback callback) = 0; | |||
|
|||
virtual std::string GetExternalWalletType() const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code that relies on this method may need to be rewritten when we improve how we handle external wallets internally.
Currently, SetExternalWalletType
is used to set a pref, which mostly serves to control which wallet type will be returned from GetExternalWallet
. This was a hack to work around the fact that the front-end design expects to be able to retrieve a populated mojom::ExternalWallet
structure, even when the user is not connected to any wallet provider.
Ideally, this pref would not be necessary: the engine would know which wallet is currently connected (if any), and the front-end would not expect to get "login" URLs from the ExternalWallet
structure. In that case we'd remove the SetExternalWalletType
method.
Code that relies on GetExternalWalletType
(a sync method), may have to be rewritten in the future, and I would prefer that we not have more implementations using the SetExternalWalletType
hack going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zenparsing mentioned in our meeting that this is good for now, but let's not use GetExternalWalletType
beyond this going forward.
This reverts commit 4ec8301.
Resolves brave/brave-browser#18471
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: