-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat(dashdirect): polling API after a puchase #1101
feat(dashdirect): polling API after a puchase #1101
Conversation
…ashdirect-homescreen
deviceID = UUID.randomUUID().toString(), | ||
amountUSD = amountValue.toBigDecimal().toDouble(), | ||
paymentCurrency = Constants.DASH_CURRENCY, | ||
deviceID = UUID.randomUUID().toString(), // TODO |
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.
I'll fix this in the next story.
val giftCard = GiftCard( | ||
id = giftCardId, | ||
id = UUID.randomUUID().toString(), |
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.
Because gift card ID isn't available at the time we save the dummy record, I figure it's better to have a UUID here and separate fields for the service.
android:fragment="de.schildbach.wallet.ui.preference.AboutFragment" | ||
android:title="@string/about_title" /> | ||
|
||
</preference-headers> |
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.
Doesn't look like these fragments are used now anywhere.
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.
This is from the version 6 settings screens.
public String httpUserAgent() { | ||
return httpUserAgent(packageInfo().versionName); | ||
} | ||
|
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.
In the ongoing effort to remove dependencies on the WalletApplication
, I moved this code into a separate service class.
@@ -130,102 +122,6 @@ protected void error(Exception x, final int messageResId, final Object... messag | |||
} | |||
} | |||
|
|||
public final static class BluetoothRequestTask extends RequestPaymentRequestTask { |
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.
Doesn't seem to be used.
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.
Bluetooth features were part of the app in prior versions, though they were probably not used by many. Like NFC it was an alternate way to send payments or payment requests to another user's device.
import org.slf4j.LoggerFactory | ||
import java.io.IOException | ||
|
||
abstract class HttpDirectPaymentTask( |
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.
These classes are just Kotlin copies of the java classes and as such not very useful. When we rewrite code to Kotlin we should think about how to make use of coroutines and simplify execution flow for the caller.
val localizedMessage: ResourceString | ||
) : Exception(innerException) | ||
|
||
object PaymentIntentParser { |
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.
InputParser
is hard to use from Kotlin and is responsible for too many things. Most callers know which parsing functionality they need and do not require all of the callbacks InputParser
has.
I think it's better to have several dedicated parsing classes instead.
public abstract class ResolveDnsTask { | ||
private final Handler backgroundHandler; | ||
private final Handler callbackHandler; | ||
|
||
public ResolveDnsTask(final Handler backgroundHandler) { | ||
this.backgroundHandler = backgroundHandler; | ||
this.callbackHandler = new Handler(Looper.myLooper()); | ||
} |
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.
This may have been used for the Trusted Peer feature which didn't make from version 6 to version 7.
It is a feature that I would like to bring back, but we can always go back in time to get the code and probably rewrite most of it.
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.
I agree. If there is a story for bringing it back, we can mention this file in there.
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.
Looks great.
Issue being fixed or feature implemented
SendCoinsTaskRunner
is refactored to make it less convoluted.PackageInfo
-related information moved fromWalletApplication
into a separate class.Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: