Repository navigation
Feat(coinbase): error handling - #897
HashEngineering merged 106 commits into
Conversation
…itory and an implementation for the interface - set up web services for payment_methods, place_buy_order, commit_order and send_funds_to_wallet
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…r_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…i models - update implementation in CoinBaseRepository.kt and CoinbaseServicesViewModel.kt to for buy/commit/send flows
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…t.kt - change user authorization scope for coinbase in CoinBaseWebClientActivity.kt - inject wallet data provider in WalletDataProviderModule.kt - update calls to get payment methods, place/commit buy orders and send funds to dash wallet
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt # wallet/src/de/schildbach/wallet/ui/coinbase/CoinBaseWebClientActivity.kt
- update event on EnterAmountFragment.kt -> record event for coinbase flow only
- rollback to using Event wrapper class in Coinbase flow to ensure navigation is only fired once
…baseServicesFragment.kt - propagate logging of Coinbase events from EnterAmountFragment.kt to CoinbaseBuyDashFragment.kt
…the withdrawal limit of the account
…to feature-coinbase-error-handling # Conflicts: # common/src/main/res/values/colors.xml
…to feature-coinbase-error-handling # Conflicts: # common/src/main/java/org/dash/wallet/common/ui/payment_method_picker/PaymentMethodPicker.kt # common/src/main/java/org/dash/wallet/common/util/GenericUtils.java # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/repository/CoinBaseRepository.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/service/CoinBaseServicesApi.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashOrderReviewFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseBuyDashViewModel.kt # integrations/coinbase-integration/src/main/res/navigation/nav_coinbase.xml # integrations/coinbase-integration/src/main/res/values/strings.xml # wallet/src/de/schildbach/wallet/ui/coinbase/CoinBaseWebClientActivity.kt
| android:background="@color/divider_color" | ||
| app:layout_constraintTop_toBottomOf="@id/coinbase_header_label" /> | ||
|
|
||
| <ImageView |
There was a problem hiding this comment.
After a discussion with Ross, he pointed out that this coinbase label is actually an image
| public static String getLocaleCurrencyCode(){ | ||
| NumberFormat numberFormat = NumberFormat.getCurrencyInstance(getDeviceLocale()); | ||
| return numberFormat.getCurrency().getCurrencyCode(); | ||
| } |
There was a problem hiding this comment.
In some cases, this will return a different code than what the app is using.
Examples: VEF (official for Venezuella) instead of VES. Belarus also changed its currency code (older devices have the older code).
The CurrencyInfo class has some functions to handle these cases, though not all. Obsolete (like for Belarus), but not for VEF -> VES.
Guess, we need to check for crashes on KRIP devices.
There was a problem hiding this comment.
Ohh I see, will take a look at it now !
There was a problem hiding this comment.
@HashEngineering updated the implementation of this function as per your suggestions.
There was a problem hiding this comment.
Great work on this fix.
- remove unnecessary line from CoinBaseServicesApi.kt file
|
|
||
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
| binding.closeBtn.setOnClickListener { findNavController().navigateUp() } |
There was a problem hiding this comment.
This is why, as I mentioned before, we should not use a navigation controller for simple dialogs. This line makes it impossible to reuse this dialog in my story because there is no navigation controller in the wallet module.
Moreover, this dialog doesn't even need to have a separate backing class, we can use AdaptiveDialog with a custom layout.
It's fine for this PR, but I'll have to refactor this a bit to be able to reuse it.
Syn-McJ
left a comment
There was a problem hiding this comment.
@ClaudeHangui would be nice to remove logging from the PaymentMethodPicker and move it down to Coinbase module.
|
|
||
| public String getCoinbaseUserWithdrawalRemaining() { | ||
| return prefs.getString(PREFS_KEY_COINBASE_USER_WITHDRAWAL_REMAINING, getCoinbaseUserWithdrawalLimitAmount()); | ||
| } |
There was a problem hiding this comment.
We keep adding things to this Configuration class which will balloon it sooner or later beyond manageable. I'm thinking we should split it into module-specific configuration classes + a global one in the future.
There was a problem hiding this comment.
Yes, I was wondering the same thing.
The common module doesn't need to know about settings/configuration that are specific to other modules. When we do make a change for module-specific vs global, we must take care not to break or lose any settings.
| showSearch = false | ||
| ) { _, index, dialog -> | ||
| dialog.dismiss() | ||
| analytics.logEvent(AnalyticsConstants.Coinbase.CHANGE_PAYMENT_METHOD, bundleOf()) |
There was a problem hiding this comment.
This is the same mistake as before with the EnterAmount fragment. This component should not care about analytics, and it might be used in other integration modules. AnalyticsService should be injected.
There was a problem hiding this comment.
this is a merge error from my side !
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:shape="rectangle"> | ||
| <solid android:color="@color/steel_gray_50" /> | ||
| <corners android:radius="14dp" /> |
There was a problem hiding this comment.
Instead of adding a whole bunch of drawables for various backgrounds, you could use the rounded_background.xml with a theme, like this:
<View
...
android:background="@drawable/rounded_background"
android:theme="@style/SearchInputBackground"
in styles:
<style name="SearchInputBackground">
<item name="backgroundColor">@color/gray_40</item>
<item name="strokeColor">@color/gray_40</item>
<item name="cornerRadius">8dp</item>
</style>
There was a problem hiding this comment.
let me try it out !
- set new styles for dialog_withdrawal_limit_info.xml - update UI for dialog_withdrawal_limit_info.xml
- restore implementation for CoinbaseBuyDashFragment.kt & CoinbaseServicesFragment.kt
Issue being fixed or feature implemented
The purpose of this story was to handle the case where a coinbase user would attempt to make a dash purchase for an amount over the authorised limit defined in his account
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: